简体   繁体   中英

c# windows authentication for a asp.net web interface

I need to do windows authentication for a web interface asp.net.
I have set up config authentication mode equal to windows.

For windows authentication, we need to set up only this:
- <authentication mode="Windows" />

and in IIS we need to:
-remove anonymous access
-check integrated windows authentication.

Do we need to any other thing for windows authentication?
How to get username for validating in c#?

Thanks

No, nothing else is required for windows authentication (assuming you only need authentication and not impersonation) in an asp.net application. You can now get the user's identity from

(WindowsIdentity)HttpContext.Current.User.Identity;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM