I have an ASP.NET web application using Windows authentication and impersonation. Here is the relevant part of web.config:
<authentication mode="Windows"/> <identity impersonate="true"/>
The application code is now trying to access the file ( XDocument.Load ) that an authenticated user has access to. This one worked perfectly fine until we started getting the following exception instead:
System.UnauthorizedAccessException: Access to the path '...' is denied.
(Obviously, the administrator tells me that "nothing has changed on the server.")
I was able to “fix” the problem by granting it the rights to identify the application pool. However, I do not understand why this fixed the problem.
My question is: If impersonation is used, why is it necessary for the application pool identifier to have access to the files used? Do you need access to username and application pool name? Or just an application pool id? If the latter, what is the meaning of impersonation?
source share