public override void CheckCredentials(string login, string password, string server, int portNumber, bool startTls) { try { _ldapHelper.CheckCredentials(login, password, server, portNumber, startTls); } catch (LdapException e) { if (e.ErrorCode != Constants.LDAP_ERROR_INVALID_CREDENTIALS) { log.ErrorFormat("Internal LDAP authentication error: {0}.", e); throw new COMException(); } throw new DirectoryServicesCOMException(); } catch (Exception e) { log.ErrorFormat("Internal AD authentication error: {0}.", e); throw new COMException(); } }