asp.net web.config impersonation vs application pool identity

后端 未结 2 590
借酒劲吻你
借酒劲吻你 2021-01-12 00:54

If I impersonate a user in the web.config but the application runs under an application pool which uses another identity, which identity would be used when you access resour

2条回答
  •  北恋
    北恋 (楼主)
    2021-01-12 01:31

    When you access resources on the server the user will be the one specified on the impersonation configuration NOT the one on the application pool

    Impersonation enabled for a specific identity. In this instance, ASP.NET impersonates the token generated using an identity specified in the Web.config file.

    
    

    Impersonation enabled. In this instance, ASP.NET impersonates the token passed to it by IIS, which is either an authenticated user or the anonymous Internet user account.

     
    

    Source: MSDN

    In case you're interested, here you have an article with a Identity matrix for different impersonate scenarios.

    And yes, you can impersonate programatically as Alex Dn said

提交回复
热议问题