Improved LDAP authentication method