我目前有一个 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