1

using (PrincipalContext pc = new PrincipalContext(ContextType.Domain, domainName)) { isWindowsAutenticated = pc.ValidateCredentials(username, password);
}

If pass to this code many wrong passwords for a user, then pass in the right password, it still returns false even though the password is definitely correct.

Any suggestions to get around this is appreciated.

TheWommies
  • 4,922
  • 11
  • 61
  • 79

1 Answers1

1

It does matter what username you pass in:

  1. joe
  2. domain\joe
  3. joe@domain.com

MSDN does not specify it but my experience says the first one is the only correct and comparison is case insensitive.

UserControl
  • 14,766
  • 20
  • 100
  • 187