標籤:style blog http io ar color sp for strong
以下皆是理論知識,未經證實。
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賦予足夠的許可權更簡單
關於asp.net impersonation的一些謠傳