We are using the PrincipalContext.ValidateCredentials method to validate the user credentials. We observed recently that this method is taking more time and due to this application is timed out.
During our initial analysis we found that if we pass the ContextOptions, application can validate much quicker. As per MSDN document if we don’t set this option the default combination
using (var context = new PrincipalContext(ContextType.Domain, this.activeDirectoryDomainName, this.activeDirectoryOrganizationalUnits))
{
if (context.ValidateCredentials(username, password, ContextOptions.Negotiate |
ContextOptions.Signing | ContextOptions.Sealing) == false)
{
}
}
is applied, ideally without passing this parameter or passing with this parameter the result should be same. Please clarify.