I've an application with a logon screen for users to authenticate themselves against the domain. I've made use of the System.DirectoryServices.AccountManagement PrincipalContext/UserPrincipal classes for this.
PrincipalContext domain = new PrincipalContext(ContextType.Domain, "mydomain");
if (domain.ValidateCredentials(UserName, Password))
{
//do stuff
}
This works quite well in the vast majority of cases. However, for a few select people, this "domain.ValidateCredentials" method will automatically prompt for a smart card insertion when it finds that the UserName is valid in the domain. Simply closing the prompt again will allow my application to proceed, but I would much rather get rid of it completely.
I've not had much luck finding a cause/solution for this. Any assistance would be appreciated!