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" |
Beta Was this translation helpful? Give feedback.
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. |
Beta Was this translation helpful? Give feedback.
@mridah The
CredentialDialog
class 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…