【发布时间】:2018-02-22 23:54:25
【问题描述】:
我正在尝试在我的 web 应用程序中使用带有 spring security 的 LDAP 用户身份验证,但得到 error 52e,下面是我的 spring security ldap 身份验证代码:
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.ldapAuthentication()
.contextSource().url("ldap://192.168.1.5:389/DC=zonetest,DC=lk")
.managerDn("CN=administrator@zonetest.lk,DC=zonetest,DC=lk").managerPassword("P@ssw0rd")
.and()
.userSearchBase("OU=SL Users")
.userSearchFilter("(CN={0})");
}
截图中提供了我的 Ldap 结构供参考:
我在邮递员客户端收到此错误
{
"timestamp": 1505368170503,
"status": 401,
"error": "Unauthorized",
"message": "[LDAP: error code 49 - 80090308: LdapErr: DSID-0C0903C5, comment: AcceptSecurityContext error, data 52e, v2580\u0000]; nested exception is javax.naming.AuthenticationException: [LDAP: error code 49 - 80090308: LdapErr: DSID-0C0903C5, comment: AcceptSecurityContext error, data 52e, v2580\u0000]",
"path": "/"
}
请帮帮我。
【问题讨论】:
-
您确定可以在您的姓名中使用空格吗? “SL 用户”
-
我已尝试删除 ou 名称中的空格并将 ou 设为“SLUsers”,但仍然是 Ldap 52e 错误。
-
(www-01.ibm.com/support/docview.wss?uid=swg21290631) 52e 用于无效凭据,因此用户可用,您确定您使用正确的凭据吗?您是否对密码进行了散列/加密?
-
不,我没有加密密码
标签: authentication spring-boot spring-security ldap spring-security-ldap