Search in sources :

Example 1 with EndpointLdapAuthenticationProvider

use of org.apereo.cas.web.security.authentication.EndpointLdapAuthenticationProvider in project cas by apereo.

the class CasWebSecurityConfigurerAdapter method configureLdapAuthenticationProvider.

/**
 * Configure ldap authentication provider.
 *
 * @param auth the auth
 * @param ldap the ldap
 */
protected void configureLdapAuthenticationProvider(final AuthenticationManagerBuilder auth, final LdapSecurityActuatorEndpointsMonitorProperties ldap) {
    if (isLdapAuthorizationActive()) {
        val connectionFactory = LdapUtils.newLdaptiveConnectionFactory(ldap);
        val authenticator = LdapUtils.newLdaptiveAuthenticator(ldap);
        endpointLdapAuthenticationProvider = new EndpointLdapAuthenticationProvider(ldap, securityProperties, connectionFactory, authenticator);
        auth.authenticationProvider(endpointLdapAuthenticationProvider);
    } else {
        LOGGER.trace("LDAP authorization is undefined, given no LDAP url, base-dn, search filter or role/group filter is configured");
    }
}
Also used : lombok.val(lombok.val) EndpointLdapAuthenticationProvider(org.apereo.cas.web.security.authentication.EndpointLdapAuthenticationProvider)

Aggregations

lombok.val (lombok.val)1 EndpointLdapAuthenticationProvider (org.apereo.cas.web.security.authentication.EndpointLdapAuthenticationProvider)1