looking for some info on where to change this…
I have a .net 4 web app sitting on one box and its SQL db sitting on another.
The users windows AD login is picked up and used throughout the app with
System.Security.Principal.WindowsIdentity.GetCurrent().Name;
If I run the app locally, I get the correct login eg “MyDomain\MyLogin”,
If I hit the app on its host box the login picked up becomes “IIS APPPOOL\ASB”,
ASB being the name of the AppPool used (and the name of the app).
I really need to return “MyDomain\MyLogin”, so should I use a different approach?
thanks
If you want the web application to run the security context of the connected user, then you need to add the following to the
<system.web>section of your web.config file:The first line tells IIS how to authenticate users and the second tells ASP.Net that you want to run the web application in the security context of the connected user as opposed to the security context of the IIS application pool.
Note that you can also use the identity element to specify that all requests are to be run in the context of a specific user.