How do I impersonate a specific (fixed) identity?

From Guidance Share

Jump to: navigation, search

J.D. Meier, Prashant Bansode, Alex Mackman


If you need to impersonate a specific (fixed) identity, set the impersonate attribute to true and supply the identity credentials using username and password attributes of the <identity> element. Impersonate specific or fixed identity to access all the local resources from ASP.NET application using original user’s security context. Important: Ideally you should not use fixed identity impersonation, instead create a application pool running under that identity and assign your application to the application pool. As impersonation carries lot of overhead and should be used only when required. For impersonating a fixed windows identity, configure the web.config as follows.

<authentication mode="Windows" />
<identity impersonate="true" username="UserName" password="P@ssw0rd" />

More Information

For more information on using impersonation, see “How To: Use Impersonation and Delegation in ASP.NET 2.0” at

Personal tools