hello in my domain we have an app where domain admin logon with user/password . for validate credential are valide i use this code.
public bool IsValidDomainCredential(string user , string password)
{
if (password == null || user == null) { return false; }
bool valid = false;
using (PrincipalContext context = new PrincipalContext(ContextType.Domain,"DWfoo.foo"))
{
valid = context.ValidateCredentials(user, password);
}
return valid;
}
it worked well but this year our admin have mixed autentification smartcart and password.
and something in smartcard driver seem interact with this code cuz when it execute it crash the application with exeption.
System.DirectoryServices.Protocols.DirectoryOperationException
The server can not handle directory requests
sometime it will not crash and ask for code PIN of the smartcard then if i don't cancel it crash again if i cancel i can logon.
i'm afraid this will happen at any application call on active directory and i have 0 idea how to totaly ignor smartcard driver and interaction.