use of org.apereo.cas.authentication.support.RejectResultCodeLdapPasswordPolicyHandlingStrategy in project cas by apereo.
the class LdapAuthenticationConfiguration method createLdapPasswordPolicyHandlingStrategy.
private LdapPasswordPolicyHandlingStrategy createLdapPasswordPolicyHandlingStrategy(final LdapAuthenticationProperties l) {
if (l.getPasswordPolicy().getStrategy() == PasswordPolicyProperties.PasswordPolicyHandlingOptions.REJECT_RESULT_CODE) {
LOGGER.debug("Created LDAP password policy handling strategy based on blacklisted authentication result codes");
return new RejectResultCodeLdapPasswordPolicyHandlingStrategy();
}
final Resource location = l.getPasswordPolicy().getGroovy().getLocation();
if (l.getPasswordPolicy().getStrategy() == PasswordPolicyProperties.PasswordPolicyHandlingOptions.GROOVY && location != null) {
LOGGER.debug("Created LDAP password policy handling strategy based on Groovy script [{}]", location);
return new GroovyLdapPasswordPolicyHandlingStrategy(location);
}
LOGGER.debug("Created default LDAP password policy handling strategy");
return new DefaultLdapPasswordPolicyHandlingStrategy();
}
Aggregations