error handling
This commit is contained in:
parent
dc0d9a8dce
commit
dcc40b0a63
2 changed files with 5 additions and 19 deletions
|
@ -333,7 +333,7 @@ public class AuthenticationProcessor {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Response authenticate() throws AuthException {
|
public Response authenticate() throws AuthException {
|
||||||
logger.info("AUTHENTICATE");
|
logger.debug("AUTHENTICATE");
|
||||||
event.event(EventType.LOGIN);
|
event.event(EventType.LOGIN);
|
||||||
event.client(clientSession.getClient().getClientId())
|
event.client(clientSession.getClient().getClientId())
|
||||||
.detail(Details.REDIRECT_URI, clientSession.getRedirectUri())
|
.detail(Details.REDIRECT_URI, clientSession.getRedirectUri())
|
||||||
|
|
|
@ -357,31 +357,17 @@ public class LoginActionsService {
|
||||||
logger.error("failed authentication: " + e.getError().toString(), e);
|
logger.error("failed authentication: " + e.getError().toString(), e);
|
||||||
if (e.getError() == AuthenticationProcessor.Error.INVALID_USER) {
|
if (e.getError() == AuthenticationProcessor.Error.INVALID_USER) {
|
||||||
event.error(Errors.USER_NOT_FOUND);
|
event.error(Errors.USER_NOT_FOUND);
|
||||||
return session.getProvider(LoginFormsProvider.class)
|
return ErrorPage.error(session, Messages.INVALID_USER);
|
||||||
.setError(Messages.INVALID_USER)
|
|
||||||
.setClientSessionCode(code)
|
|
||||||
.createLogin();
|
|
||||||
|
|
||||||
} else if (e.getError() == AuthenticationProcessor.Error.USER_DISABLED) {
|
} else if (e.getError() == AuthenticationProcessor.Error.USER_DISABLED) {
|
||||||
event.error(Errors.USER_DISABLED);
|
event.error(Errors.USER_DISABLED);
|
||||||
return session.getProvider(LoginFormsProvider.class)
|
return ErrorPage.error(session, Messages.ACCOUNT_DISABLED);
|
||||||
.setError(Messages.ACCOUNT_DISABLED)
|
|
||||||
.setClientSessionCode(code)
|
|
||||||
.createLogin();
|
|
||||||
|
|
||||||
} else if (e.getError() == AuthenticationProcessor.Error.USER_TEMPORARILY_DISABLED) {
|
} else if (e.getError() == AuthenticationProcessor.Error.USER_TEMPORARILY_DISABLED) {
|
||||||
event.error(Errors.USER_TEMPORARILY_DISABLED);
|
event.error(Errors.USER_TEMPORARILY_DISABLED);
|
||||||
return session.getProvider(LoginFormsProvider.class)
|
return ErrorPage.error(session, Messages.ACCOUNT_TEMPORARILY_DISABLED);
|
||||||
.setError(Messages.ACCOUNT_TEMPORARILY_DISABLED)
|
|
||||||
.setClientSessionCode(code)
|
|
||||||
.createLogin();
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
event.error(Errors.INVALID_USER_CREDENTIALS);
|
event.error(Errors.INVALID_USER_CREDENTIALS);
|
||||||
return session.getProvider(LoginFormsProvider.class)
|
return ErrorPage.error(session, Messages.INVALID_USER);
|
||||||
.setError(Messages.INVALID_USER)
|
|
||||||
.setClientSessionCode(code)
|
|
||||||
.createLogin();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue