@Override
    public List<MessageDescriptor> handle(final AuthenticationResponse response,
                                          final PasswordPolicyContext configuration) throws LoginException {
        LOGGER.debug("Attempting to handle LDAP account state for [{}]", response);
        if (!this.attributesToErrorMap.isEmpty() && response.isSuccess()) {
            LOGGER.debug("Handling policy based on pre-defined attributes");
            handlePolicyAttributes(response);
        }

        val state = response.getAccountState();
        if (state == null && !response.isSuccess()) {
            handleFailingResponse(response, configuration);
        }

        if (state == null) {
            LOGGER.debug("Account state not defined. Returning empty list of messages.");
            return new ArrayList<>();
        }
        val messages = new ArrayList<MessageDescriptor>();
        handleError(state.getError(), response, configuration, messages);
        handleWarning(state.getWarning(), response, configuration, messages);

        return messages;
    }
Instantiates a new account state handler, that populates
the error map with LDAP error codes and corresponding exceptions.
support/cas-server-support-ldap-core/src/main/java/org/apereo/cas/authentication/support/DefaultLdapAccountStateHandler.java