// create a "principal context" - e.g. your domain (could be machine, too)
using (PrincipalContext pc = new PrincipalContext(ContextType.Domain, "DOMAIN"))
{
// validate the credentials
bool isValid = pc.ValidateCredentials(@"user", "password");
if (isValid == true)
return "user is valid";
else
return "user is not valid";
}
No comments:
Post a Comment