Spring Security AD LDAP: error code 1 - 000004DC: LdapErr: DSID-0C0906E8

后端 未结 1 821
孤独总比滥情好
孤独总比滥情好 2020-12-11 07:04

I am trying to connect Ldap from spring security, getting connection errors. Could some one suggest what is wrong with this configuration,

UsernamePa

相关标签:
1条回答
  • 2020-12-11 07:11

    Lets assume user is trying to login with username XXX and password YYY. Usually LDAP authentication works like this:

    1. Bind to the LDAP with technical account
    2. Search for the user with the username XXX => get his DN
    3. Try to bind to the LDAP using found DN and password YYY

    Your error is suggesting that you didnt't do the first step (technical account binding) correctly.

    Try adding userDn and password to your context source (this is from the official JavaDoc):

    <bean id="contextSource"
            class="org.springframework.security.ldap.DefaultSpringSecurityContextSource">
        <constructor-arg value="ldap://monkeymachine:389/dc=springframework,dc=org"/>
        <property name="userDn" value="cn=manager,dc=springframework,dc=org"/>
        <property name="password" value="password"/>
    </bean>
    
    0 讨论(0)
提交回复
热议问题