question

SteveLast-1302 avatar image
0 Votes"
SteveLast-1302 asked BruceZhang-MSFT answered

Configure .net app to run as current user

Is it possible to configure the .net app and app pool to run as the user who's currently running the app? I have looked everywhere and have seen asp.net impersonation, authentication method and nothing seem to work.

Part of the application is to read/generate files from folder that Person A have access to. If Person B doesn't have access to target folder then app will give error message. Doing impersonation with provided service account will defeat this purpose.

windows-server-iis
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

You probably want a different kind of application, not ASP.Net.

1 Vote 1 ·

1 Answer

BruceZhang-MSFT avatar image
0 Votes"
BruceZhang-MSFT answered

Hi @SteveLast-1302 ,

If you want to set app pool run as the user who's currently running the app, the only way is add user in windows user group. It cannot changed when application running, then user login. Even using impersonation.

What you can configure is the user who run the application. However, you don't want to use impersonation. So there's no useful methods to change user at IIS level. You need to set it in application by writing code.

So I recommend you to use authentication filter and authorization filter.



If the answer is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our  documentation  to enable e-mail notifications if you want to receive the related email notification for this thread.


Best regards,
Bruce Zhang



5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.