Implemented most of LDAP authentication