【发布时间】:2016-12-06 07:52:05
【问题描述】:
我目前有一个 Spring-boot 应用程序,它从 Active Directory 获取员工数据,并将它们显示为 JSON。
但是,我不想直接链接到 Active Directory,我想使用 Active Directory 轻量级服务。
我以为我可以设置连接并以相同的方式进行连接,但我不断收到错误 49(无效凭据)错误。我正在使用与 Active Directory 相同的凭据。
这是 Spring.xml 配置凭据:
<bean id="contextSource" class="org.springframework.ldap.core.support.LdapContextSource">
<property name="url" value="ldap://example.com:389" />
<property name="base" value=" DC=example,DC=com" />
<property name="userDn" value="jsmith@example.com" />
<property name="password" value="password" />
</bean>
<bean id="ldapTemplate" class="org.springframework.ldap.core.LdapTemplate">
<constructor-arg ref="contextSource" />
<property name="ignorePartialResultException" value="true" />
</bean>
如果我尝试将 url 更改为 AD LDS url(使用 localhost),我会收到 Ldap 错误 49。有人对这些技术有经验吗?请帮忙。
编辑:
如果我尝试使用我的 Active Directory 域用户名,我会得到:
The authentication failed
- [LDAP: error code 49 - 8009030C: LdapErr: DSID-0C0903C4, comment: AcceptSecurityContext error, data 2030, v295a
如果我尝试使用我得到的 userDN:
The authentication failed
- [LDAP: error code 80 - 80090304: LdapErr: DSID-0C0903C4, comment: AcceptSecurityContext error, data 20ee, v295a
【问题讨论】:
-
您是否尝试使用 Apache Directory Studio 之类的 LDAP 浏览器连接到 AD LDS?
-
是的,我有。它也不允许我进入那里。但是,如果我使用 Softerra 的 LDAP 浏览器,并使用“当前用户”凭据,我可以进入。如果我尝试在 Softerra 浏览器中手动添加我的凭据,它也会报错。
-
请使用完整的错误堆栈更新问题。错误代码 49 具有关联的子错误代码,如 532、533 等,以指示错误的具体原因,例如帐户禁用、密码过期。
-
好的,我已经完成了。
标签: java spring active-directory ldap adlds