关于asp.net impersonation的一些谣传

以下皆是理论知识,未经证实。

system.web下面的配置节

<identity impersonate="true" />

或者<identity impersonate="true" userName="accountname" password="password" />

也可以通过调用windows API来用代码来进行身份模拟,这篇文章很到位:http://www.cnblogs.com/awpatp/archive/2010/02/02/1662277.html

Note   Impersonation is local to a particular thread. When code changes threads, such as  when using thread pooling, the new thread executes using the process  identity by default. 

inpersonation和IIS集成模式不太兼容(ASP.NET Integrated mode is unable to impersonate the request identity in the BeginRequest and AuthenticateRequest pipeline stages.),可通过一个配置来调整: http://www.allenconway.net/2010/11/how-to-use-impersonation-in-aspnet.html

<validation validateIntegratedModeConfiguration="false"/>

http://mvolo.com/breaking-changes-for-aspnet-20-applications-running-in-integrated-mode-on-iis-70/

也许相对于imperonation,让程序在一个generic account下运行(application pool identity),然后为这个generic account赋予足够的权限更简单

原文地址:https://www.cnblogs.com/teamleader/p/4131861.html