我們試圖使用Spring安全性對我們的企業LDAP進行身份驗證。我正在使用ActiveDirectoryLdapAuthenticationProvider
。下面是從Spring配置文件中的片段:Spring ActiveDirectoryLdapAuthenticationProvider handleBindException - 提供的密碼無效錯誤
<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>
我越來越:ActiveDirectoryLdapAuthenticationProvider handleBindException Active Directory身份驗證失敗:提供的密碼無效的錯誤。
我的理解是,這是因爲LDAP綁定失敗,因爲它正在尋找userDN /憑證。我們如何在配置文件中指定這些信息?
在使用ActiveDirectoryLdapAuthenticationProvider
之前,我使用了<ldap-authentication-provider>
和DefaultSpringSecurityContextSource
。在配置DefaultSpringSecurityContextSource
bean時,我能夠指定userDN /密碼。有人可以告訴我如何在使用ActiveDirectoryLdapAuthenticationProvider
進行配置時指定userDn和密碼?
感謝您的解釋和URL盧克!所有這一切現在都有道理。出於某種原因,我認爲使用ActiveDirectoryLdapAuthenticationProvider是正確的實施方式。看起來我錯了。 – ignatan