Package org.openengsb.core.api.oauth

Examples of org.openengsb.core.api.oauth.OAuthData


        public Builder oAuthConfiguration(Map<String, String> firstURLParameters,
                Map<String, String> secondURLParameters, String firstURL, String secondURL,
                String redirectParameterName, String intermediateParameterName) {
            attr.oAuthConfiguration =
                new OAuthData(firstURLParameters, secondURLParameters, firstURL, secondURL, redirectParameterName,
                    intermediateParameterName);
            return this;
        }
View Full Code Here


        Link<OAuthData> pageLink =
            new Link<OAuthData>("popupLink", new OAuthPageModel(
                new Model<OAuthData>(attribute.getOAuthConfiguration()))) {
                @Override
                public void onClick() {
                    OAuthData oauth = getModelObject();
                    String redirectURL = buildRedirectURL(getRequest());
                    oauth.setRedirectURL(redirectURL);
                    String link = oauth.generateFirstCallLink();
                    OAuthPageFactory.putOAuthObject(getSession().getId(), oauth);
                    getRequestCycle().scheduleRequestHandlerAfterCurrent(new RedirectRequestHandler(link));
                }
            };
        pageLink.setPopupSettings(popupSettings);
View Full Code Here

        add(new PopupCloseLink<String>("close"));
        add(new Label("oAuthResultLabel", notStarted));
    }

    public OAuthPage(PageParameters pp) throws Exception {
        OAuthData oauth = OAuthPageFactory.getOAuthObject(getSession().getId());
        if (oauth != null) {
            String intermediate = oauth.getIntermediateParameterName();
            if (!pp.get(intermediate).isEmpty()) {
                String code = pp.get(intermediate).toOptionalString();
                OAuthData data = OAuthPageFactory.getOAuthObject(getSession().getId());
                data.addEntryToSecondParams(intermediate, code);

                String accessToken = performOAuthValidation(new URL(data.generateSecondCallLink()));
                OAuthPageFactory.removeOAuthObject(getSession().getId());

                String successful = new StringResourceModel("oAuth.Successful", this, null).getString();
                add(new Label("oAuthResultLabel", successful + accessToken));
                add(new PopupCloseLink<String>("close"));
View Full Code Here

TOP

Related Classes of org.openengsb.core.api.oauth.OAuthData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.