posted 8/24/2013 by Raghav Khunger
Following are the outcomes of my test which I did in my ASP.NET site with app pool set as "Network Service" identity. I did these tests with Forms Authentication.
Case 1: When impersonation is false i.e
<identity impersonate="false" />
System.Security.Principal.WindowsIdentity.GetCurrent().Name will give "NT AUTHORITY\NETWORK SERVICE" value.
If you try to do System.Web.Hosting.HostingEnvironment.Impersonate() even then it will give you "NT AUTHORITY\NETWORK SERVICE" value.
Case 2: When impersonation is set to true i.e
<identity impersonate="true" />
System.Security.Principal.WindowsIdentity.GetCurrent().Name will give "NT AUTHORITY\IUSR" value.
Case 3: When impersonation is set to true and set with credentials i.e
<identity impersonate="true" userName="My-PC\Administrator" password="test"/>
System.Security.Principal.WindowsIdentity.GetCurrent().Name will give "My-PC\Administrator" value.
What kind of email newsletter would you prefer to receive from CodeAsp.Net? 18