我正在尝试使用Spring LDAP连接到AD。我可以使用简单身份验证连接到服务器,但对于其中一个服务器,只有GSS-API身份验证是活动的。我无法使用Spring LDAP连接到此服务器。
有人能帮我解决这个问题吗?任何帮助都是非常感谢的!
下面是我的代码;
@Configuration
@Profile("prod")
public class AppProdConfig {
@Bean
public LdapContextSource ldapContextSource(){
LdapContextSource ldapContextSource = new LdapContextSource();
ldapContextSource.setUrls(new String[]{"ldaps://1.1.1.1:636","ldaps://2.2.2.2:636"});
ldapContextSource.setBase("ou=users,ou=usersAndGroups,dc=ecommerce,dc=company");
ldapContextSource.setUserDn("user");
ldapContextSource.setPassword("password123");
return ldapContextSource;
}
@Bean
public LdapTemplate ldapTemplate(LdapContextSource ldapContextSource){
LdapTemplate ldapTemplate = new LdapTemplate(ldapContextSource);
return ldapTemplate;
}
}发布于 2018-02-04 07:58:06
Spring LDAP不支持这一点。My library将为您完成此操作。
https://stackoverflow.com/questions/43107254
复制相似问题