ValidateCredentials() returns FALSE on First Call but TRUE on Subsequent Calls
- by Nick Gotch
I'm using the following code to authenticate users on my web service:
using (PrincipalContext context = new PrincipalContext(ContextType.Domain, domain))
{
return context.ValidateCredentials(userName, password);
}
The obstacle I'm running into is that the first call to ValidateCredentials() is returning false but subsequent calls return true. I placed a breakpoint at this line and in the Intermediate window I see the same results: first call returns false, second returns true, even though nothing was changed (by me) between calls.
The 'domain' is String.Empty but I've also tried it with the actual domain name and get the same results.
I'm not that versed in network administration so any help would be appreciated,