2

I have enabled windows authentication and disabled rest of the authentications on my IIS 7.5. In my web application web.config I have set

<authentication mode="Windows">

When I try to get logged in user as WindowsIdentity.GetCurrent().Name; it's giving defaultappool as the user rather than the logged in windows user. This used to work correctly with IIS5.1 but not with IIS7.5. Is there anything else I should modify?

user799891
  • 285
  • 1
  • 4
  • 17
  • Check this article http://msdn.microsoft.com/en-us/library/ff649264.aspx. I'm not aware that something has changed for IIS 7.5 but take into account that the article is pretty old. – Claudio Redi Sep 22 '12 at 00:13

1 Answers1

1

You can get the user identity from the HttpContext.User Property.

JamieSee
  • 12,696
  • 2
  • 31
  • 47