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;
}
Aggregations