I need to validate that the user inputs are corrects to the current session windows. Thus I use the code below :
private void LoginUser(string username, string password)
{
bool isCredentialValid = false;
using (PrincipalContext context = new PrincipalContext(ContextType.Domain))
{
isCredentialValid = context.ValidateCredentials(username, password);
}
if (isCredentialValid)
{
//
}
else
{
//
}
}
The problem that I always get false as ValidateCredentials
result.
Rq : I'm using .Net 4.5 framework