Search in sources :

Example 1 with AbstractLdapAuthenticator

use of org.springframework.security.ldap.authentication.AbstractLdapAuthenticator in project spring-security by spring-projects.

the class AbstractLdapAuthenticationManagerFactory method getProvider.

private LdapAuthenticationProvider getProvider() {
    AbstractLdapAuthenticator authenticator = getAuthenticator();
    LdapAuthenticationProvider provider;
    if (this.ldapAuthoritiesPopulator != null) {
        provider = new LdapAuthenticationProvider(authenticator, this.ldapAuthoritiesPopulator);
    } else {
        provider = new LdapAuthenticationProvider(authenticator);
    }
    if (this.authoritiesMapper != null) {
        provider.setAuthoritiesMapper(this.authoritiesMapper);
    }
    if (this.userDetailsContextMapper != null) {
        provider.setUserDetailsContextMapper(this.userDetailsContextMapper);
    }
    return provider;
}
Also used : AbstractLdapAuthenticator(org.springframework.security.ldap.authentication.AbstractLdapAuthenticator) LdapAuthenticationProvider(org.springframework.security.ldap.authentication.LdapAuthenticationProvider)

Example 2 with AbstractLdapAuthenticator

use of org.springframework.security.ldap.authentication.AbstractLdapAuthenticator in project spring-security by spring-projects.

the class AbstractLdapAuthenticationManagerFactory method getAuthenticator.

private AbstractLdapAuthenticator getAuthenticator() {
    AbstractLdapAuthenticator authenticator = createDefaultLdapAuthenticator();
    if (this.userSearchFilter != null) {
        authenticator.setUserSearch(new FilterBasedLdapUserSearch(this.userSearchBase, this.userSearchFilter, this.contextSource));
    }
    if (this.userDnPatterns != null && this.userDnPatterns.length > 0) {
        authenticator.setUserDnPatterns(this.userDnPatterns);
    }
    authenticator.afterPropertiesSet();
    return authenticator;
}
Also used : AbstractLdapAuthenticator(org.springframework.security.ldap.authentication.AbstractLdapAuthenticator) FilterBasedLdapUserSearch(org.springframework.security.ldap.search.FilterBasedLdapUserSearch)

Example 3 with AbstractLdapAuthenticator

use of org.springframework.security.ldap.authentication.AbstractLdapAuthenticator in project spring-security by spring-projects.

the class LdapAuthenticationProviderConfigurer method createLdapAuthenticator.

/**
 * Creates the {@link LdapAuthenticator} to use
 * @param contextSource the {@link BaseLdapPathContextSource} to use
 * @return the {@link LdapAuthenticator} to use
 */
private LdapAuthenticator createLdapAuthenticator(BaseLdapPathContextSource contextSource) {
    AbstractLdapAuthenticator ldapAuthenticator = (this.passwordEncoder != null) ? createPasswordCompareAuthenticator(contextSource) : createBindAuthenticator(contextSource);
    LdapUserSearch userSearch = createUserSearch();
    if (userSearch != null) {
        ldapAuthenticator.setUserSearch(userSearch);
    }
    if (this.userDnPatterns != null && this.userDnPatterns.length > 0) {
        ldapAuthenticator.setUserDnPatterns(this.userDnPatterns);
    }
    return postProcess(ldapAuthenticator);
}
Also used : AbstractLdapAuthenticator(org.springframework.security.ldap.authentication.AbstractLdapAuthenticator) LdapUserSearch(org.springframework.security.ldap.search.LdapUserSearch) FilterBasedLdapUserSearch(org.springframework.security.ldap.search.FilterBasedLdapUserSearch)

Aggregations

AbstractLdapAuthenticator (org.springframework.security.ldap.authentication.AbstractLdapAuthenticator)3 FilterBasedLdapUserSearch (org.springframework.security.ldap.search.FilterBasedLdapUserSearch)2 LdapAuthenticationProvider (org.springframework.security.ldap.authentication.LdapAuthenticationProvider)1 LdapUserSearch (org.springframework.security.ldap.search.LdapUserSearch)1