user386258
user386258

Reputation: 1953

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

Upvotes: 2

Views: 1545

Answers (1)

vc 74
vc 74

Reputation: 38179

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;

Upvotes: 4

Related Questions