长期倾听者,第一次来电。
我已经在以下位置下载了 spring 身份验证 ldap 示例: https://spring.io/guides/gs/authenticating-ldap/ 进入STS。效果很好。
但是,我想尝试让它与真正的 LDAP 数据库一起使用,例如 forumsys.com 上的人提供的数据库: http://www.forumsys.com/en/tutorials/integration-how-to/ldap/online-ldap-test-server/
我当前的configureGlobal配置是:
@Autowired
public void configureGlobal(AuthenticationManagerBuilder authBuilder) throws Exception {
authBuilder
.ldapAuthentication()
.userSearchFilter("(uid={0},dc=example,dc=com)")
.userSearchBase("")
.contextSource()
.url("ldap://ldap.forumsys.com:389/dc=example,dc=com")
.managerDn("cn=read-only-admin,dc=example,dc=com")
.managerPassword("password");
}
当我尝试使用“tesla/password”或“einstein/password”登录时,这会返回错误的凭据错误。 任何人都可以建议configureGlobal中的哪些设置会导致有效登录?
谢谢, 酸痛
最佳答案
这似乎有效:
authBuilder
.ldapAuthentication()
.userSearchFilter("(uid={0})")
.userSearchBase("")
.contextSource()
.url("ldap://ldap.forumsys.com:389/dc=example,dc=com")
.managerDn("cn=read-only-admin,dc=example,dc=com")
.managerPassword("password");
关于java - Spring认证LDAP示例和真实的LDAP服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41601316/