Permissions when trying to read / write a file in an ASP.NET application

We have a .net web application. The web application is configured in IIS and runs under AppPool, which runs under the domain \ User1

This web application has C # .NET code that provides access to the file on the server. The problem is that only for the domain \ User2 has the rights to this file for reading / editing.

We know that .NET code will run under the credentials of the AppPool account (i.e.: Domain \ User1). Therefore, if we try to read / write the file in the .NET code of the web application, then it will cause an error.

What are the possible approaches that I can use to access this file? I am not allowed to change the AppPool user in accordance with our company policy. If this was possible, then the code could access the file. In addition, I cannot change the permission of the file and allow it access to the \ User2 domain due to company policy.

What other option do I have?

Can I only run the read / write portion of a code file as Domain \ User2 through .NET code?

+4
source share
3 answers

, " asp.net, , , . :

  • acl ,

, .

+4

/ ? , Domain\User2 .

+3

Better you can go with "WindowsAuthentication" in IIS, this will help you access WindowAccount in your web application. You can also limit user respect for UserGroup, user type, etc.

+1
source

All Articles