public class DefaultAccountStateHandler extends java.lang.Object implements AccountStateHandler
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<org.ldaptive.auth.AccountState.Error,javax.security.auth.login.LoginException> |
errorMap
Map of account state error to CAS authentication exception.
|
protected org.slf4j.Logger |
logger
Logger instance.
|
Constructor and Description |
---|
DefaultAccountStateHandler()
Instantiates a new account state handler, that populates
the error map with LDAP error codes and corresponding exceptions.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<MessageDescriptor> |
handle(org.ldaptive.auth.AuthenticationResponse response,
LdapPasswordPolicyConfiguration configuration)
Handles the account state producing an error or warning messages as appropriate to the state.
|
protected void |
handleError(org.ldaptive.auth.AccountState.Error error,
org.ldaptive.auth.AuthenticationResponse response,
LdapPasswordPolicyConfiguration configuration,
java.util.List<MessageDescriptor> messages)
Handle an account state error produced by ldaptive account state machinery.
|
protected void |
handlePolicyAttributes(org.ldaptive.auth.AuthenticationResponse response)
Maps boolean attribute values to their corresponding exception.
|
protected void |
handleWarning(org.ldaptive.auth.AccountState.Warning warning,
org.ldaptive.auth.AuthenticationResponse response,
LdapPasswordPolicyConfiguration configuration,
java.util.List<MessageDescriptor> messages)
Handle an account state warning produced by ldaptive account state machinery.
|
void |
setAttributesToErrorMap(java.util.Map<java.lang.String,java.lang.Class<javax.security.auth.login.LoginException>> attributesToErrorMap) |
protected java.util.Map<org.ldaptive.auth.AccountState.Error,javax.security.auth.login.LoginException> errorMap
protected transient org.slf4j.Logger logger
public DefaultAccountStateHandler()
public java.util.List<MessageDescriptor> handle(org.ldaptive.auth.AuthenticationResponse response, LdapPasswordPolicyConfiguration configuration) throws javax.security.auth.login.LoginException
AccountStateHandler
handle
in interface AccountStateHandler
response
- LDAP authentication response containing attributes, response controls, and account state that
can be used to determine user account state.configuration
- Password policy configuration.javax.security.auth.login.LoginException
- When account state causes authentication failure.protected void handleError(org.ldaptive.auth.AccountState.Error error, org.ldaptive.auth.AuthenticationResponse response, LdapPasswordPolicyConfiguration configuration, java.util.List<MessageDescriptor> messages) throws javax.security.auth.login.LoginException
Override this method to provide custom error handling.
error
- Account state error.response
- Ldaptive authentication response.configuration
- Password policy configuration.messages
- Container for messages produced by account state error handling.javax.security.auth.login.LoginException
- On errors that should be communicated as login exceptions.protected void handleWarning(org.ldaptive.auth.AccountState.Warning warning, org.ldaptive.auth.AuthenticationResponse response, LdapPasswordPolicyConfiguration configuration, java.util.List<MessageDescriptor> messages)
Override this method to provide custom warning message handling.
warning
- the account state warning messages.response
- Ldaptive authentication response.configuration
- Password policy configuration.messages
- Container for messages produced by account state warning handling.public void setAttributesToErrorMap(java.util.Map<java.lang.String,java.lang.Class<javax.security.auth.login.LoginException>> attributesToErrorMap)
protected void handlePolicyAttributes(org.ldaptive.auth.AuthenticationResponse response)
response
- the authentication response.