title: authentication failed using ldapsearch
body: <p>I created a local ldap server with Apache Directory Studio. A user entry is created with the uid "djiao1" and password "123456" (SHA hashed password).</p>
  
  <p>I was able to search the user with the following ldapsearch command:</p>
  
  <pre><code>ldapsearch -H ldap://localhost:10389 -x uid=djiao1
  # extended LDIF
  #
  # LDAPv3
  # base &lt;&gt; (default) with scope subtree
  # filter: uid=djiao1
  # requesting: ALL
  #
  
  # djiao, Users, example.com
  dn: cn=djiao,ou=Users,dc=example,dc=com
  sn: jiao
  cn: djiao
  objectClass: top
  objectClass: inetOrgPerson
  objectClass: person
  objectClass: organizationalPerson
  userPassword:: e3NoYX1mRXFOQ2NvM1lxOWg1WlVnbEQzQ1pKVDRsQnM9
  uid: djiao1
  
  # search result
  search: 2
  result: 0 Success
  
  # numResponses: 2
  # numEntries: 1
  </code></pre>
  
  <p>However if I run with -W to prompt password and type in "123456" I get "invalid credentials" error:</p>
  
  <pre><code>ldapsearch -H ldap://localhost:10389 -W -x uid=djiao1
  Enter LDAP Password: 
  ldap_bind: Invalid credentials (49)
  additional info: INVALID_CREDENTIALS: Bind failed: Invalid authentication
  </code></pre>
  
  <p>I tried the very long string shown as the userPassword <code>e3NoYX1mRXFOQ2NvM1lxOWg1WlVnbEQzQ1pKVDRsQnM9</code> and still got the same error. </p>
  
  <p>The below screenshot the verification is successful with password 123456 for the user. Why doesn't the password work?<a href="https://i.stack.imgur.com/Q23Yr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Q23Yr.png" alt="enter image description here"></a></p>