I'm trying to get used to II7, having worked with IIS6 for quite some time.
In IIS 6, I'd set <identity impersonate="true"/>
in the web.config, and make sure that I applied the correct NTFS permissions to the IUSR_[MACHINENAME] account if a folder required more than read permissions.
In IIS 7, I'm having trouble duplicating this setup without resorting to applying too many permissions.
If I use <identity impersonate="true"/>
in IIS 7, Environment.Username tells me that I'm indeed impersonating the IUSR account, which is the new equivalent. However, if I log into the admin portion of the website using forms authentication it impersonates differently than I expect.
With NetworkService set in the application pool:
- not logged in: IUSR, not impersonating: [MACHINENAME]$
- logged in: [MACHINENAME]$, not impersonating: [MACHINENAME]$
With LocalService set in the application pool:
- not logged in: IUSR, not imperonating: LOCAL SERVICE
- logged in: LOCAL SERVICE, not impersonating: LOCAL SERVICE
If I give the IIS_IUSRS account the NTFS permissions I can make things work just fine, but this seems odd. How can I always impersonate the IUSR account? Or, am I supposed to give the NTFS permissions to IIS_IUSRS?
I'd appreciate a good explanation of this change in IIS7 - I've searched around and can't find an explanation for this usage with forms authentication.