protected void handlePolicyAttributes(final AuthenticationResponse response) throws LoginException {
        val attributes = response.getLdapEntry().getAttributes();
        for (val attr : attributes) {
            if (this.attributesToErrorMap.containsKey(attr.getName()) && Boolean.parseBoolean(attr.getStringValue())) {
                val clazz = this.attributesToErrorMap.get(attr.getName());
                throw Unchecked.supplier(() -> clazz.getDeclaredConstructor().newInstance()).get();
            }
        }
    }
Maps boolean attribute values to their corresponding exception.
This handles ad-hoc password policies.

@param response the authentication response.
@throws LoginException the login exception
support/cas-server-support-ldap-core/src/main/java/org/apereo/cas/authentication/support/DefaultLdapAccountStateHandler.java