【发布时间】:2018-04-13 09:36:47
【问题描述】:
我正在使用 spring boot 开发一个 API,它将针对我们公司的 AD 验证用户和密码。我厌倦了嵌入 LDAP 测试服务器的示例示例,它工作得非常好。但是,每当我尝试连接到我们的 LDAP 服务器时,我都会看到以下错误消息。
这就是我正在做的。
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth
.ldapAuthentication()
.userDnPatterns("uid={0},ou=people")
.groupSearchBase("ou=groups")
.contextSource()
.url("ldap://<company AD server>/dc=springframework,dc=org")
.and()
.passwordCompare()
.passwordEncoder(new LdapShaPasswordEncoder())
.passwordAttribute("userPassword");
错误信息:-
尝试对用户进行身份验证时发生内部错误。 org.springframework.security.authentication.InternalAuthenticationServiceException: LDAP 处理期间发生未分类异常;嵌套的 异常是 javax.naming.NamingException: [LDAP: error code 1 - 000004DC:LdapErr:DSID-0C0906E8,注释:为了执行这个 操作一个成功的绑定必须在连接上完成。,数据 0, v1db1]
我不确定我哪里出错了。我试着用谷歌搜索,但没有运气。我正在使用带有 Spring Security 的 Eclipse。
【问题讨论】:
标签: java spring spring-security active-directory