title: LDAP invalid login credentials
body: <p>I installed sldap on my ubuntu 12.04 system.<a href="https://help.ubuntu.com/community/OpenLDAPServer" rel="nofollow">https://help.ubuntu.com/community/OpenLDAPServer</a>
  I can add /search records to lsdap from terminal.e.g. I can add ldif file.</p>
  
  <pre><code>ldapadd -x -D cn=admin,dc=test,dc=com -W -f ldap-add.ldif
  </code></pre>
  
  <p>and it ask me password .I entered pass000 and it added new entry.its working fine .i can add search records from terminal. Now I tried It from my spring application .i added dependency ldap-core to my pom .i set up bean etc. every thing is fine except it gives me error in valid credetials thouh I entered same as I entered while ading ldif file from terminal. My bean configuration is </p>
  
  <pre><code>&lt;!-- ldap template --&gt;
      &lt;ldap:context-source id="contextSource" url="ldap://localhost:389"
          base="dc=test,dc=com" username="cn=admin" password="pass000" /&gt;
  
      &lt;ldap:ldap-template id="ldapTemplate"
          context-source-ref="contextSource" /&gt;
  
      &lt;bean id="personDao" class="com.cheasyy.cofinding.dao.PersonDaoImpl"&gt;
          &lt;property name="ldapTemplate" ref="ldapTemplate" /&gt;
      &lt;/bean&gt;
  </code></pre>
  
  <p>It gives error </p>
  
  <pre><code>org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.ldap.AuthenticationException: [LDAP: error code 49 - Invalid Credentials]; nested exception is javax.naming.AuthenticationException: [LDAP: error code 49 - Invalid Credentials]
      org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:894)
      org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
      org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
      com.thetransactioncompany.cors.CORSFilter.doFilter(CORSFilter.java:205)
      com.thetransactioncompany.cors.CORSFilter.doFilter(CORSFilter.java:266)
  root cause
  
  org.springframework.ldap.AuthenticationException: [LDAP: error code 49 - Invalid Credentials]; nested exception is javax.naming.AuthenticationException: [LDAP: error code 49 - Invalid Credentials]
      org.springframework.ldap.support.LdapUtils.convertLdapException(LdapUtils.java:191)
      org.springframework.ldap.core.support.AbstractContextSource.createContext(AbstractContextSource.java:356)
      org.springframework.ldap.core.support.AbstractContextSource.doGetContext(AbstractContextSource.java:140)
  </code></pre>
  
  <p>If with same credentials I can add ldif file from terminal then why not with my spring application?is their anything missing in configuration?</p>