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");
}