Set the base properties of the ContextSource environment

I need to set some basic properties (for example, disable SSL checking with a custom factory socket) ContextSource via GlobalAuthenticationConfigurerAdapter . Can I use LdapAuthenticationProviderConfigurer.contextSource (BaseLdapPathContextSource) ?

@Configuration
protected static class AuthenticationConfig extends GlobalAuthenticationConfigurerAdapter {

    public void init(AuthenticationManagerBuilder auth) throws Exception {
        // @formatter:off
        auth.ldapAuthentication().contextSource()
            .url("ldaps://xxx:636")
            .managerDn("uid=emt,ou=funcids,ou=applications,o=xxx,c=us")
            .managerPassword("XA1zWgAU")
            .and()
            .userSearchBase("o=xxx,c=us")
            .userSearchFilter("(&(uid={0})(objectclass=person))")
            .groupSearchBase("ou=internal,o=xxx,c=us")
            .groupSearchFilter("(&(uid={0})(objectclass=person)(ismemberof=*))");
        // @formatter:on
    }
}
+4
source share

All Articles