ValidateCredentials() method fails for local user when machine is not connected to internet
Hi,
I am using ValidateCredentials() method to validate a local user. However, I get an exception “Network name was not found” when the machine is not part of any domain and is not connected to the internet.
This is how I do it –
using (PrincipalContext pc = new PrincipalContext(ContextType.Machine, null))
bool isValid = pc.ValidateCredentials(username, password);
As per my understanding when the name parameter is null for a Machine context type, then the credentials are validated with the local computer SAM store.
Hence, I am trying to understand why this method fails to validate credentials of a local user when machine is not connected to any network. Is it mandatory to have internet access even if it validates against local store?