Announcement Announcement Module
Collapse
No announcement yet.
Error setting LDAP authentication. Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Error setting LDAP authentication.

    Hi Team,

    I am getting following exception after setting the contextsource in beans.xml

    Exception in thread "main" org.springframework.ldap.UncategorizedLdapExceptio n: Uncategorized exception occured during LDAP processing; nested exception is javax.naming.NamingException: [LDAP: error code 1 - 000020D6: SvcErr: DSID-031006CC, problem 5012 (DIR_ERROR), data 0

    i had set the contextsource in this format changing the url nad all as per our ldap.

    <bean id="contextSource" class="org.springframework.ldap.core.support.LdapC ontextSource">
    <property name="url" value="ldap://localhost:389" />
    <property name="base" value="dc=example,dc=com" />
    <property name="userDn" value="cn=Manager" />
    <property name="password" value="secret" />
    </bean>


    Can someone pls tell me the exact format of setting the same.

    Thanks in advance

  • #2
    can someone pls help out:

    the format to set up

    base:
    Userdn:

    Comment


    • #3
      Originally posted by Vidhya View Post
      Hi Team,

      I am getting following exception after setting the contextsource in beans.xml

      Exception in thread "main" org.springframework.ldap.UncategorizedLdapExceptio n: Uncategorized exception occured during LDAP processing; nested exception is javax.naming.NamingException: [LDAP: error code 1 - 000020D6: SvcErr: DSID-031006CC, problem 5012 (DIR_ERROR), data 0

      i had set the contextsource in this format changing the url nad all as per our ldap.

      <bean id="contextSource" class="org.springframework.ldap.core.support.LdapC ontextSource">
      <property name="url" value="ldap://localhost:389" />
      <property name="base" value="dc=example,dc=com" />
      <property name="userDn" value="cn=Manager" />
      <property name="password" value="secret" />
      </bean>


      Can someone pls tell me the exact format of setting the same.

      Thanks in advance

      Comment


      • #4
        Vidhya,
        Your configuration looks correct. Can you tell us what directory server you are using and may be post the complete exception stack trace?

        Comment


        • #5
          Hi

          Thanks,

          After the below mentioned additions it worked for us.

          <bean id="ldapTemplate" class="org.springframework.ldap.core.LdapTemplate" >
          <property name="ignorePartialResultException" value="true"></property>
          <constructor-arg ref="contextSource" />
          </bean>

          In the authenticate method

          AndFilter filter = new AndFilter();
          filter.and(
          new EqualsFilter("samaccountname",empId));
          System.out.println(filter.toString());
          return ldapTemplate.authenticate(DistinguishedName.EMPTY_ PATH, filter
          .toString(), password);


          Thanks ,

          Comment

          Working...
          X