我需要some base properties到ContextSource设置GlobalAuthenticationConfigurerAdapter(如禁用自定义套接字工厂的SSL检查)。我的选择是使用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
}
}