【发布时间】:2018-09-20 12:25:49
【问题描述】:
我有一个使用 LDAP 配置的应用程序,它运行良好。但现在我需要提取用户管理器的详细信息。我无法获取详细信息,请查找详细信息
@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) throws
Exception {
auth
.ldapAuthentication()
.userSearchBase("dc=ab,dc=test,dc=com")
.userSearchFilter("TestName={0}")
.groupSearchBase("ou=Groups,dc=ab,dc=test,dc=com")
.groupSearchFilter("member={1}")
.groupRoleAttribute("cn")
.userDetailsContextMapper(userContextMapper())
.contextSource(contextSource());
}
@Bean
public LdapContextSource contextSource() {
LdapContextSource contextSource= new LdapContextSource();
contextSource.setUrl("ldap:test");
contextSource.setUserDn("CN=,OU=Accounts,DC=ab,DC=test,DC=com");
contextSource.setPassword();
return contextSource;
}
@Bean
public InetOrgPersonContextMapper userContextMapper() {
return new InetOrgPersonContextMapper();
}
我可以获取用户,但我需要用户管理器详细信息。
【问题讨论】:
标签: spring spring-boot spring-security spring-ldap