I have an asp.net 4.0 web app running on our company intranet. It is using Windows authentication. It needs to do some file IO stuff with files on a network drive. I am getting permission errors, because the IIS App Pool account obviously does not have access to those files.
If I add <identity impersonate="true />
to the web.config file, I get the same error.
If I add <identity impersonate="true" username="myname" password="...">
to the web.config file, then the app works if for cases where I have access to the files in question - but I need other people to be able to use it to process files on their departments' network share.
There is no way the security guys will let me give blanket permission for the IIS default account or a new batch admin on this server to have permissions all over the network (and rightly so). Users should only be able to run this app on files they already have access to.
How do get the app to run the file IO processes as the logged-in user?