diff --git a/services/src/main/java/org/keycloak/authentication/AuthenticationProcessor.java b/services/src/main/java/org/keycloak/authentication/AuthenticationProcessor.java index 36fcf35e8d..c192a04513 100755 --- a/services/src/main/java/org/keycloak/authentication/AuthenticationProcessor.java +++ b/services/src/main/java/org/keycloak/authentication/AuthenticationProcessor.java @@ -333,7 +333,7 @@ public class AuthenticationProcessor { } public Response authenticate() throws AuthException { - logger.info("AUTHENTICATE"); + logger.debug("AUTHENTICATE"); event.event(EventType.LOGIN); event.client(clientSession.getClient().getClientId()) .detail(Details.REDIRECT_URI, clientSession.getRedirectUri()) diff --git a/services/src/main/java/org/keycloak/services/resources/LoginActionsService.java b/services/src/main/java/org/keycloak/services/resources/LoginActionsService.java index 980c4ffa04..18c1d10cd9 100755 --- a/services/src/main/java/org/keycloak/services/resources/LoginActionsService.java +++ b/services/src/main/java/org/keycloak/services/resources/LoginActionsService.java @@ -357,31 +357,17 @@ public class LoginActionsService { logger.error("failed authentication: " + e.getError().toString(), e); if (e.getError() == AuthenticationProcessor.Error.INVALID_USER) { event.error(Errors.USER_NOT_FOUND); - return session.getProvider(LoginFormsProvider.class) - .setError(Messages.INVALID_USER) - .setClientSessionCode(code) - .createLogin(); - + return ErrorPage.error(session, Messages.INVALID_USER); } else if (e.getError() == AuthenticationProcessor.Error.USER_DISABLED) { event.error(Errors.USER_DISABLED); - return session.getProvider(LoginFormsProvider.class) - .setError(Messages.ACCOUNT_DISABLED) - .setClientSessionCode(code) - .createLogin(); - + return ErrorPage.error(session, Messages.ACCOUNT_DISABLED); } else if (e.getError() == AuthenticationProcessor.Error.USER_TEMPORARILY_DISABLED) { event.error(Errors.USER_TEMPORARILY_DISABLED); - return session.getProvider(LoginFormsProvider.class) - .setError(Messages.ACCOUNT_TEMPORARILY_DISABLED) - .setClientSessionCode(code) - .createLogin(); + return ErrorPage.error(session, Messages.ACCOUNT_TEMPORARILY_DISABLED); } else { event.error(Errors.INVALID_USER_CREDENTIALS); - return session.getProvider(LoginFormsProvider.class) - .setError(Messages.INVALID_USER) - .setClientSessionCode(code) - .createLogin(); + return ErrorPage.error(session, Messages.INVALID_USER); } }