0
votes

I'm trying to authenticate with organization ldap server. When I enter the credentials I'm facing this error. Can someone help?

Uncategorized exception occured during LDAP processing; nested exception is javax.naming.NamingException: [LDAP: error code 1 - 000004DC: LdapErr: DSID-0C090A7D, comment: In order to perform this operation a successful bind must be completed on the connection., data 0, v3839]; remaining name 'username=aestools,ou=people'

This is my configuration:

@Override
    public void configure(AuthenticationManagerBuilder auth) throws Exception {
        auth
        .ldapAuthentication().userDnPatterns("username={0},ou=people").contextSource()
        .url("ldap://ldap.example.com:389/dc=ms,ddc=ds,dc=example,dc=com").and().passwordCompare()
        .passwordAttribute("password");
1

1 Answers

0
votes

I think you need to authenticate an account that can view the LDAP records or something, maybe this will work

  auth
    .ldapAuthentication()
    .userDnPatterns("username={0},ou=people")
    .contextSource()
    .managerDn("cn=admin,ou=people,dc=ms,dc=ds,dc=example,dc=com")
    .managerPassword("adminPassword123") 
    .url("ldap://ldap.example.com:389/dc=ms,dc=ds,dc=example,dc=com")
    .and()
    .passwordCompare()
    .passwordAttribute("password");

So basically you need to fill in .managerDn() and .managerPassword() with info of the account that has permission to view LDAP server's records. This Spring security LDAP is quite new to me, so sorry if my answer not work.