TheWommies
TheWommies

Reputation: 5072

Using PrincipalContext to ValidateCredentials fails with right password after sending many wrong passwords

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.

Upvotes: 1

Views: 875

Answers (1)

UserControl
UserControl

Reputation: 15159

It does matter what username you pass in:

  1. joe
  2. domain\joe
  3. [email protected]

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

Upvotes: 1

Related Questions