小编ign*_*tan的帖子

Spring ActiveDirectoryLdapAuthenticationProvider handleBindException - 提供的密码无效错误

我们正在尝试使用Spring安全性来对我们的企业LDAP进行身份验证.我正在使用ActiveDirectoryLdapAuthenticationProvider.下面是Spring配置文件的片段:

<security:authentication-manager erase-credentials="true">
    <security:authentication-provider  ref="ldapActiveDirectoryAuthProvider"/>
</security:authentication-manager>

<bean id="ldapActiveDirectoryAuthProvider" class="org.springframework.security.ldap.authentication.ad.ActiveDirectoryLdapAuthenticationProvider">
<constructor-arg value="DC=xxx,DC=ds,DC=yyy,DC=com" />  
<constructor-arg value="ldap://xxx.ds.yyy.com:389" />
<property name="convertSubErrorCodesToExceptions" value="true"/>
</bean>
Run Code Online (Sandbox Code Playgroud)

我得到:ActiveDirectoryLdapAuthenticationProvider handleBindException Active Directory身份验证失败:提供的密码无效错误.

我的理解是,这是因为LDAP绑定失败,因为它正在寻找userDN /凭证.我们如何在配置文件中指定此信息?

在使用之前ActiveDirectoryLdapAuthenticationProvider,我使用<ldap-authentication-provider>和使用了这个DefaultSpringSecurityContextSource.我可以在配置DefaultSpringSecurityContextSourcebean 时指定userDN /密码.在配置使用时,有人能告诉我如何指定userDn和密码ActiveDirectoryLdapAuthenticationProvider吗?

passwords active-directory spring-security spring-ldap

2
推荐指数
1
解决办法
1万
查看次数