title: LDAP: error code 49 - Invalid Credentials when logging in
body: <p>I'm trying to integrate our app to an active directory. I've followed this guide for starters: <a href="https://grails.org/wiki/AcegiSecurity%20Plugin%20-%20LDAP%20Tutorial" rel="nofollow noreferrer">https://grails.org/wiki/AcegiSecurity%20Plugin%20-%20LDAP%20Tutorial</a> but I'm getting an error:</p>
  
  <p>[LDAP: error code 49 - Invalid Credentials]; nested exception is javax.naming.AuthenticationException: [LDAP: error code 49 - Invalid Credentials]; after logging in (connected to a LDAP directory OpenDJ)
  Here's my acegi security config</p>
  
  <pre><code>    // LDAP/ActiveDirectory
  useLdap = true
  ldapRetrieveGroupRoles = false
  ldapRetrieveDatabaseRoles = true
  ldapSearchSubtree = true
  ldapGroupRoleAttribute = 'cn'
  ldapPasswordAttributeName = 'userPassword'
  ldapServer = 'ldap://localhost:389' // 'ldap://ad.example.com', 'ldap://monkeymachine:389/dc=acegisecurity,dc=org'
  ldapManagerDn = 'cn=Directory Manager,dc=example,dc=com'
  ldapManagerPassword = 'Password123'
  ldapSearchBase = 'dc=example,dc=com' // 'ou=users,dc=example,dc=com'
  ldapSearchFilter = '(uid={0})' //, '(mailNickname={0})'
  ldapGroupSearchBase = 'ou=company_name,dc=example,dc=com'
  ldapGroupSearchFilter = 'uniquemember={0}'
  ldapUsePassword = true
  </code></pre>
  
  <p>What does this error means? is my admin(ldapManagerDn) credentials wrong? or the login credentials?</p>
  
  <p>Thanks</p>
  
  <p>NOTE: I'm using acegi 0.5.2 because our applcation still uses grails 1.3.6</p>