I want to develop an ASP.NET application that can detect the user logged on a Window Domain. These credentials are going to be used to logging on the ASP.NET application.
How can I do this?
Thanks!
In IIS, turn on Integrated Windows Authentication, and in code, if you use:
Request.ServerVariables["LOGON_USER"]
it will return the windows username of the logged in user, i.e. MYDOMAIN\MYUSERNAME
For ASP.net, you can probably use
HttpContext.Current.User.Identity
If IIS is configured correctly (no anonymous logons, at least)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With