Example usage for org.springframework.security.ldap.authentication AbstractLdapAuthenticator setUserDnPatterns

List of usage examples for org.springframework.security.ldap.authentication AbstractLdapAuthenticator setUserDnPatterns

Introduction

In this page you can find the example usage for org.springframework.security.ldap.authentication AbstractLdapAuthenticator setUserDnPatterns.

Prototype

public void setUserDnPatterns(String[] dnPattern) 

Source Link

Document

Sets the pattern which will be used to supply a DN for the user.

Usage

From source file:io.gravitee.management.idp.ldap.authentication.LdapAuthenticationProviderConfigurer.java

/**
 * Creates the {@link LdapAuthenticator} to use
 *
 * @param contextSource the {@link BaseLdapPathContextSource} to use
 * @return the {@link LdapAuthenticator} to use
 *//*from  w  w w .j av  a2  s  . c  o m*/
private LdapAuthenticator createLdapAuthenticator(BaseLdapPathContextSource contextSource) {
    AbstractLdapAuthenticator ldapAuthenticator = passwordEncoder == null
            ? createBindAuthenticator(contextSource)
            : createPasswordCompareAuthenticator(contextSource);
    LdapUserSearch userSearch = createUserSearch();
    if (userSearch != null) {
        ldapAuthenticator.setUserSearch(userSearch);
    }
    if (userDnPatterns != null && userDnPatterns.length > 0) {
        ldapAuthenticator.setUserDnPatterns(userDnPatterns);
    }
    return postProcess(ldapAuthenticator);
}