Package edu.stanford.bmir.protege.web.client.ui.login

Examples of edu.stanford.bmir.protege.web.client.ui.login.LoginUtil


            public void onFailure(Throwable reason) {
            }

            @Override
            public void onSuccess() {
                final LoginUtil loginUtil = new LoginUtil();
                UserId userId = Application.get().getUserId();
                if (userId.isGuest()) {
                    Boolean isLoginWithHttps = Application.get().getClientApplicationProperty(WebProtegePropertyName.HTTPS_ENABLED, false);
                    if (isLoginWithHttps) {
                        String httpsPort = Application.get().getClientApplicationProperty(WebProtegePropertyName.HTTPS_PORT).orNull();
                        String authenUrl = loginUtil.getAuthenticateWindowUrl(AuthenticationConstants.AUTHEN_TYPE_LOGIN, httpsPort);
                        authenUrl = authenUrl + "&" + AuthenticationConstants.PROTOCOL + "=" + com.google.gwt.user.client.Window.Location.getProtocol();
                        authenUrl = authenUrl + "&" + AuthenticationConstants.DOMAIN_NAME_AND_PORT + "=" + com.google.gwt.user.client.Window.Location.getHost();
                        int randomNumber = Random.nextInt(10000);
                        authenUrl = authenUrl + "&" + AuthenticationConstants.RANDOM_NUMBER + "=" + randomNumber;
                        AdminServiceManager.getInstance().clearPreviousLoginAuthenticationData(new ClearLoginAuthDataHandler(authenUrl, loginUtil, randomNumber));
                    }
                    else {
                        loginUtil.login(isLoginWithHttps);
                    }
                }
                else {
                    GWT.log("User is already signed in");
                }
View Full Code Here


            final int providerId) {
        openIdProvImage.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                win.close();

                final LoginUtil loginUtil = new LoginUtil();
                if (!isLoginWithHttps) {
                    AdminServiceManager.getInstance().clearPreviousLoginAuthenticationData(
                            new clearLoginAuthDataHandler(providerId, loginUtil, isLoginWithHttps));

                } else {
                    openIdUtil.openProviderForOpenIdAuth(providerId, isLoginWithHttps);
                }
                if (windowCloseHandlerRegistration != null) {
                    windowCloseHandlerRegistration.removeHandler();
                }
                // Warning: this will only work for https if invoked after the call to windowCloseHandlerRegistration.removeHandler
                if (isLoginWithHttps) {
                    loginUtil.closeWindow();
                }
            }
        });
    }
View Full Code Here

            Image openIdProvImage, final int providerId) {
        openIdProvImage.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                win.close();
                openIdPopup.hide();
                final LoginUtil loginUtil = new LoginUtil();
                if (!isLoginWithHttps) {
                    AdminServiceManager.getInstance().clearPreviousLoginAuthenticationData(
                            new clearLoginAuthDataHandler(providerId, loginUtil, isLoginWithHttps));

                } else {
                    openIdUtil.openProviderForOpenIdAuth(providerId, isLoginWithHttps);
                }
                if (windowCloseHandlerRegistration != null) {
                    windowCloseHandlerRegistration.removeHandler();
                }
                // Warning: this will only work for https if invoked after the call to windowCloseHandlerRegistration.removeHandler
                if (isLoginWithHttps) {
                    loginUtil.closeWindow();
                }
            }
        });
    }
View Full Code Here

            Label openIdProvLabel, final int providerId) {
        openIdProvLabel.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                win.close();
                openIdPopup.hide();
                final LoginUtil loginUtil = new LoginUtil();
                if (!isLoginWithHttps) {
                    AdminServiceManager.getInstance().clearPreviousLoginAuthenticationData(
                            new clearLoginAuthDataHandler(providerId, loginUtil, isLoginWithHttps));

                } else {
                    openIdUtil.openProviderForOpenIdAuth(providerId, isLoginWithHttps);
                }
                if (windowCloseHandlerRegistration != null) {
                    windowCloseHandlerRegistration.removeHandler();
                }
                // Warning: this will only work for https if invoked after the call to windowCloseHandlerRegistration.removeHandler                               
                if (isLoginWithHttps) {
                    loginUtil.closeWindow();
                }
            }
        });
    }
View Full Code Here

TOP

Related Classes of edu.stanford.bmir.protege.web.client.ui.login.LoginUtil

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.