public bool IsAuthenticated(string ldap, string usr, string pwd)
{
bool authenticated = false;
try
{
DirectoryEntry entry = new DirectoryEntry(ldap, usr, pwd);
object nativeObject = entry.NativeObject;
authenticated = true;
}
catch (DirectoryServicesCOMException cex)
{
_logger.Error("DirectoryServicesCOMException occured");
_logger.Error(cex, cex.StackTrace);
}
catch (Exception ex)
{
_logger.Error($"Exception occured: {ex.Message}");
_logger.Error(ex, ex.StackTrace);
}
return authenticated;
}
public bool IsAuthenticated(string ldap, string usr, string pwd)
{
bool authenticated = false;
try
{
DirectoryEntry entry = new DirectoryEntry(ldap, usr, pwd);
object nativeObject = entry.NativeObject;
authenticated = true;
}
catch (DirectoryServicesCOMException cex)
{
_logger.Error("DirectoryServicesCOMException occured");
_logger.Error(cex, cex.StackTrace);
}
catch (Exception ex)
{
_logger.Error($"Exception occured: {ex.Message}");
_logger.Error(ex, ex.StackTrace);
}
return authenticated;
}