I have a .NET application (mix of C# and VB.NET) where I would like to display a Windows Login Dialog box (or my own dialog box) and authenticate the user using Windows Authentication. Per requirement, I need to ask the user to authenticate after AT LEAST a minute of being idle. I would prefer a .NET native way of doing Windows Authentication but interested in other ways…
Share
to authenticate a user, you can use the ValidateCredential method of the PrincipalContext. Make sure to add reference
System.DirectoryServices.AccountManagement.If you’re not validating against a domain, check other
ContextType. You can also use other option to validate the credentials (theContextOptions).