views:

14

answers:

1

Hi,

I always thought the user running the app pool was used to, for instance, access the file system when an application is trying to write a file. I have an application in IIS, setup with Windows Integrated Authentication, that tries to write a file to the file system. I always get an error unless I give permissions on the file system to the specific domain user that logged in through Windows Integrated Authentication.

Any reason why I´m observing this behaviour?

Thx in advance

+1  A: 

Are you using Impersonation? This would use the User's identity to do stuff, rather than the one of the AppPool. If you're using a third party ASP.net Application, check if they use Impersonation (for example, SharePoint does).

There is a way to revert the identity of the AppPool. Check this question which includes the RevertToSelf and HostingEnvironment.Impersonate methods. The Question is about SharePoint, but these two answers are the non-SharePoint way of reverting to the apppool, so they apply.

Michael Stum
Correct, I'm using Sharepoint. Thanks for the answer.
Dante
@Dante Cool, then SPSecurity.RunWithElevatedPrivileges is your friend :)
Michael Stum