Class LoginErrorMessages
java.lang.Object
com.irurueta.authserver.authorization.api.web.login.LoginErrorMessages
Maps the exception of a failed sign-in, which Spring Security keeps in the
SPRING_SECURITY_LAST_EXCEPTION session attribute, to the key of the message the login page shows.
An unknown user and a wrong password (a
BadCredentialsException or a
UsernameNotFoundException) deliberately share
the generic key, so the two responses are identical and the page never reveals whether an account exists. The
account status messages (locked, disabled, expired) cannot reveal it either: the authentication provider of the
password feature (PasswordAuthenticationConfiguration) only checks the status after a correct
password, so a wrong password for a disabled account is reported as bad credentials too.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringKey of the message shown for an expired account.static final StringKey of the message shown for expired credentials.static final StringKey of the message shown for a disabled account.static final StringKey of the message shown for bad credentials, an unknown user and any unexpected failure.static final StringKey of the message shown for a locked account. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
GENERIC
Key of the message shown for bad credentials, an unknown user and any unexpected failure.- See Also:
-
LOCKED
Key of the message shown for a locked account.- See Also:
-
ACCOUNT_EXPIRED
Key of the message shown for an expired account.- See Also:
-
CREDENTIALS_EXPIRED
Key of the message shown for expired credentials.- See Also:
-
DISABLED
Key of the message shown for a disabled account.- See Also:
-
-
Constructor Details
-
LoginErrorMessages
public LoginErrorMessages()
-
-
Method Details
-
keyOf
Gets the key of the message that describes a failed sign-in.- Parameters:
exception- the exception of the failed sign-in;nullwhen the session holds none.- Returns:
- the message key; the generic one for bad credentials, an unknown user and anything unexpected.
-