C# web app can access network shares but my ISAPI extension cannot - why?

84 Views Asked by At

Our C# web application on Windows/IIS v10 can access files on network shares without doing anything special. An ISAPI Extension that I wrote in C++ cannot access the same files. I am wondering why one works and not the other.

I found that ImpersonateLoggedOnUser allows me to get to the files. That requires the extension to have access to domain\userid\password for a network account that can get to the server. I am connecting to the database so I could store it in an encrypted column.

1

There are 1 best solutions below

2
Joel Coehoorn On

It depends on the User account used to run the application. This is set in the App Pool in IIS. The web application is configured the run in an App Pool as an account that has permissions to the appropriate folders. The C++ ISAPI extension is running in a different App Pool configured to use an account like Network Service that does not have permissions granted to the shares.