Search in sources :

Example 1 with AccountState

use of org.ldaptive.auth.AccountState in project cas by apereo.

the class DefaultAccountStateHandler method handle.

@Override
public List<MessageDescriptor> handle(final AuthenticationResponse response, final LdapPasswordPolicyConfiguration configuration) throws LoginException {
    if (!this.attributesToErrorMap.isEmpty() && response.getResult()) {
        LOGGER.debug("Handling policy based on pre-defined attributes");
        handlePolicyAttributes(response);
    }
    final AccountState state = response.getAccountState();
    if (state == null) {
        LOGGER.debug("Account state not defined. Returning empty list of messages.");
        return Collections.emptyList();
    }
    final List<MessageDescriptor> messages = new ArrayList<>();
    handleError(state.getError(), response, configuration, messages);
    handleWarning(state.getWarning(), response, configuration, messages);
    return messages;
}
Also used : MessageDescriptor(org.apereo.cas.authentication.MessageDescriptor) DefaultMessageDescriptor(org.apereo.cas.DefaultMessageDescriptor) PasswordExpiringWarningMessageDescriptor(org.apereo.cas.authentication.support.password.PasswordExpiringWarningMessageDescriptor) ArrayList(java.util.ArrayList) ActiveDirectoryAccountState(org.ldaptive.auth.ext.ActiveDirectoryAccountState) FreeIPAAccountState(org.ldaptive.auth.ext.FreeIPAAccountState) AccountState(org.ldaptive.auth.AccountState) PasswordExpirationAccountState(org.ldaptive.auth.ext.PasswordExpirationAccountState) EDirectoryAccountState(org.ldaptive.auth.ext.EDirectoryAccountState)

Aggregations

ArrayList (java.util.ArrayList)1 DefaultMessageDescriptor (org.apereo.cas.DefaultMessageDescriptor)1 MessageDescriptor (org.apereo.cas.authentication.MessageDescriptor)1 PasswordExpiringWarningMessageDescriptor (org.apereo.cas.authentication.support.password.PasswordExpiringWarningMessageDescriptor)1 AccountState (org.ldaptive.auth.AccountState)1 ActiveDirectoryAccountState (org.ldaptive.auth.ext.ActiveDirectoryAccountState)1 EDirectoryAccountState (org.ldaptive.auth.ext.EDirectoryAccountState)1 FreeIPAAccountState (org.ldaptive.auth.ext.FreeIPAAccountState)1 PasswordExpirationAccountState (org.ldaptive.auth.ext.PasswordExpirationAccountState)1