How to verify credentials in CredentialDialog ? #4
|
I want to verify the credentials entered against a windows user credentials ( basically check if the user knows any windows user's username and password ) How can I accomplish this ? This always shows "not verified" |
Answered by
augustoproiete
Jul 21, 2019
Replies: 1 comment
|
@mridah The You will have to write the code for validating your credentials against your Active Directory, or some other authentication system you have... For example, if you want to validate against a Active Directory in your domain, you using System.DirectoryServices.AccountManagement;
void Main()
{
using (PrincipalContext pc = new PrincipalContext(ContextType.Domain, "YOUR-DOMAIN-NAME"))
{
bool isValid = pc.ValidateCredentials("user-login", "user-password");
// ...
}
}You can find more examples on StackOverflow. |
0 replies
Answer selected by
augustoproiete
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@mridah The
CredentialDialogclass is meant to be a generic user/password dialog that you can use to capture the user's login and password and then you validate it against any authentication system you want...You will have to write the code for validating your credentials against your Active Directory, or some other authentication system you have...
For example, if you want to validate against a Active Directory in your domain, you
You can fin…