L
L
Likefire2013-11-29 14:33:55
ASP.NET
Likefire, 2013-11-29 14:33:55

Why might Windows user impersonation not work in an ASP.NET web application?

In the process of working on a web application running inside a corporate network, it was necessary to implement the execution of PowerShell instructions in this application. According to the conditions of the task, the operation must be performed under the credentials of the user who logged into the application. However, under all the conditions observed according to the documentation, the execution occurs invariably under the account of the app pool. Actually, the application in the web.config file contains tags with instructions: identity impersonate="true" and authentication mode="Windows". In the application code, the request to the environment is preceded by opening the impersonation context. I also tried the method when the impersonation context is opened using the methods of system libraries with an explicit indication of the login and password - also unsuccessfully. The application is published on a server running win 2012, IIS 8. App pool was launched under both ApplicationPoolIdentity and SYSTEM credentials, with the same (un)success. Launching another process from the application (System.Diagnostics.Process) in the impersonation context also causes the process to run under the credentials of the app pool.
The question is: what application/environment/IIS settings need to be checked and what settings should be applied correctly in order to solve the original problem?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question