title: Using String.equals compare password and authenticate user against LDAP server, Does it make any sense?
body: <p>I'm working with pretty old, big CMS (TeamSite) and it has an example how to connect it to an LDAP server. I've read the example and it work in very bizarre way.
  It just store a password in the "userPassword" field as expected but it does the validation manually instead of using the bind command.</p>
  
  <p>This doesn't make sense to me but I can be wrong here as I haven't worked with LDAP servers before. Do you have any idea why somebody would like to manually compare the password instead of using bind?</p>
  
  <p>Here is how the code looks like:</p>
  
  <pre><code>  Attribute attrPassword = attrs.get("userPassword");
    if (attrPassword.size() &gt; 0)
    {
      String storedPassword = new String((byte[])attrPassword.get(0));
  
      if (password.equals(storedPassword))
      {  
        ///.....
  </code></pre>