@Override public void singleSignOnFailed(@NotNull ServerErrorEvent.ServerConfigErrorEvent<AuthenticationFailedException> e) { getAppStateFor(e.getConfig()).ifPresent(s -> s.badLogin = true); }
@Override public void singleSignOnExecutionFailed(@NotNull SingleSignOnExecutionFailureEvent e) { onLoginFailure(new ServerErrorEvent.ServerConfigErrorEvent<>(e.getConfig(), new AuthenticationFailedException(AuthenticationFailedException.ErrorType.SSO_LOGIN, new ServerMessage(new ArrayList<>())))); }
@Override public void sessionExpired(@NotNull ServerErrorEvent.ServerConfigErrorEvent<AuthenticationFailedException> e) { // Login Errors are handled by the InvalidPasswordMonitorComponent //simpleError("Session expired for " + e.getName(), "Login Failure"); LOG.warn(e.getError()); }
new ServerErrorEvent.ServerConfigErrorEvent<>(info.getServerConfig(), te)); return createServerResultException(e, getMessage("error.TrustException.NEW_KEY", e), ConnectionErrorMessage.send().couldNotWrite(new ServerErrorEvent.ServerConfigErrorEvent<>( info.getServerConfig(), (FileSaveException) e)); } else {
if (info.hasServerConfig()) { LoginFailureMessage.send().sessionExpired(new ServerErrorEvent.ServerConfigErrorEvent<>( info.getServerConfig(), sourceAfe)); return createServerResultException(sourceException, LoginFailureMessage.send().passwordInvalid(new ServerErrorEvent.ServerConfigErrorEvent<>( info.getServerConfig(), sourceAfe)); return createServerResultException(sourceException, LoginFailureMessage.send().passwordInvalid(new ServerErrorEvent.ServerConfigErrorEvent<>( info.getServerConfig(), sourceAfe)); return createServerResultException(sourceException, LoginFailureMessage.send().singleSignOnFailed(new ServerErrorEvent.ServerConfigErrorEvent<>( info.getServerConfig(), sourceAfe)); return createServerResultException(sourceException, LoginFailureMessage.send().passwordUnnecessary(new ServerErrorEvent.ServerConfigErrorEvent<>( info.getServerConfig(), sourceAfe)); return createServerResultException(sourceException,
@Override public void passwordInvalid(@NotNull ServerErrorEvent.ServerConfigErrorEvent<AuthenticationFailedException> e) { if (shouldHandleProblem(e.getConfig(), FailureType.PASSWORD_INVALID)) { if (!e.getConfig().usesStoredPassword()) { P4Bundle.message("login.password-not-stored.error", e.getName().getDisplayName()), P4Bundle.getString("login.password-not-stored.error.title"), NotificationType.ERROR); LOG.info("Show a user notification, and use hyperlink to ask for password for " + e.getConfig()); UserMessage.showNotification(null, UserMessage.ERROR, P4Bundle.message("login.password.error", e.getName().getDisplayName()), P4Bundle.getString("login.password.error.title"), NotificationType.ERROR, (notification, hyperlinkEvent) -> { forgetLoginProblem(e.getConfig()); ApplicationPasswordRegistry.getInstance() .askForNewPassword(null, e.getConfig()); }, () -> { forgetLoginProblem(e.getConfig()); LOG.info("Not handling password invalid for " + e.getConfig());
@Override public void passwordUnnecessary(@NotNull ServerErrorEvent.ServerConfigErrorEvent<AuthenticationFailedException> e) { // Inform the user about the unnecessary password. if (shouldHandleProblem(e.getConfig(), FailureType.PASSWORD_UNNECESSARY)) { UserMessage.showNotification(null, UserMessage.WARNING, P4Bundle.message("connection.password.unnecessary.details", e.getName().getDisplayName()), P4Bundle.message("connection.password.unnecessary.title"), NotificationType.INFORMATION); // Update the password to remove the stored password. ApplicationPasswordRegistry.getInstance().remove(e.getConfig()); } else { LOG.info("Not handling password uncessary issue for " + e.getConfig()); } } });
@Override public void singleSignOnFailed(@NotNull ServerErrorEvent.ServerConfigErrorEvent<AuthenticationFailedException> e) { LOG.info("Processing single sign on failure: " + e.getError().getMessage()); if (shouldHandleProblem(e.getConfig(), FailureType.SSO)) { // No explicit action to take UserMessage.showNotification(null, UserMessage.ERROR, P4Bundle.message("error.loginsso.exec-failed", e.getConfig().getLoginSso(), e.getError().getLocalizedMessage()), P4Bundle.message("error.loginsso.exec-failed.title"), NotificationType.ERROR); // TODO once the Single Sign On can take an argument, let this prompt for the argument. } else { LOG.info("Not handling SSO problem for " + e.getConfig()); } }
@Override public void sessionExpired(@NotNull ServerErrorEvent.ServerConfigErrorEvent<AuthenticationFailedException> e) { // Force a log-in. If this fails, another message will be handled. if (shouldHandleProblem(e.getConfig(), FailureType.SESSION_EXPIRED)) { LOG.info("Session expired. Performing another login."); P4ServerComponent.perform(findBestProject(), e.getConfig(), new LoginAction()); } else { LOG.info("Not handling session expired error for " + e.getConfig()); } }
@Override public void onLoginFailure(@NotNull ServerErrorEvent.ServerConfigErrorEvent<AuthenticationFailedException> e) { ProjectConfigRegistry.this.onLoginError(e.getConfig()); } });
@Override public void passwordInvalid(@NotNull ServerErrorEvent.ServerConfigErrorEvent<AuthenticationFailedException> e) { // Login Errors are handled by the InvalidPasswordMonitorComponent //simpleError("Password invalid for " + e.getName(), "Login Failure"); LOG.warn(e.getError()); }
@Override public void passwordInvalid(@NotNull ServerErrorEvent.ServerConfigErrorEvent<AuthenticationFailedException> e) { getAppStateFor(e.getConfig()).ifPresent(s -> s.badLogin = true); }
@Override public void sslHostFingerprintMismatch(@NotNull ServerErrorEvent.ServerConfigErrorEvent<TrustException> event) { simpleError( P4Bundle.message("user-error.ssl-host-fingerprint.message", event.getName()), P4Bundle.message("user-error.ssl-host-fingerprint.title") ); LOG.warn(event.getError()); }
@Override public void passwordUnnecessary(@NotNull ServerErrorEvent.ServerConfigErrorEvent<AuthenticationFailedException> e) { getAppStateFor(e.getConfig()).ifPresent(s -> { s.badLogin = false; s.passwordUnnecessary = true; }); } });
@Override public void sessionExpired(@NotNull ServerErrorEvent.ServerConfigErrorEvent<AuthenticationFailedException> e) { getAppStateFor(e.getConfig()).ifPresent(s -> { s.badLogin = false; s.needsLogin = true; }); }
@Override public void passwordUnnecessary(@NotNull ServerErrorEvent.ServerConfigErrorEvent<AuthenticationFailedException> e) { // Login Errors are handled by the InvalidPasswordMonitorComponent //simpleError("Password unnecessary for " + e.getName(), "Login Failure"); LOG.warn(e.getError()); } });
@Override public void couldNotWrite(@NotNull ServerErrorEvent.ServerConfigErrorEvent<FileSaveException> event) { simpleError( P4Bundle.message("user-error.could-not-write.message", event.getConfig().getServerName(), event.getError().getLocalizedMessage()), P4Bundle.message("user-error.could-not-write.title")); LOG.warn(event.getError()); }
@Override public void singleSignOnFailed(@NotNull ServerErrorEvent.ServerConfigErrorEvent<AuthenticationFailedException> e) { // Login Errors are handled by the InvalidPasswordMonitorComponent // simpleError("Single sign on failed for " + e.getName(), "Login Failure"); LOG.warn(e.getError()); }