Generic handling of credentials for LDAP connection.