By default, impersonation is turned off, and you can access resources by using the ASP.NET Web application’s process identity. However, you can use impersonation to access local resources and perform operations by using the authenticated user’s identity or by using a specific Windows identity. You can enable impersonation programmatically or by applying appropriate configuration settings in the Web.config file.
Delegation allows you to use an impersonation token to access network resources. Your ability to use delegation depends on your selected authentication mechanism and appropriate account configuration. You should be careful when you use impersonation and delegation because of the additional security and scalability issues it can cause.
The most common situations where you might require impersonation and delegation are:
- Impersonating the original caller. You want to access Windows resources that are protected with ACLs configured for your application’s domain user accounts.
- Impersonating the original caller programmatically. You want to access resources predominantly by using the application’s process identity, but specific methods need to use the original caller’s identity.
- Impersonating a specific Windows identity. You need to use a specific identity or several Windows identities to access particular resources.
- Using delegation to access network resources by using an impersonated identity. You need to use an impersonated identity to access remote resources.
Referecnes:
http://www.guidanceshare.com/wiki/ASP.NET_2.0_Security_Guidelines_-_Impersonation/Delegation
http://msdn.microsoft.com/en-us/library/ms998351.aspx
http://wiki.asp.net/page.aspx/44/impersonation-and-delegation/
http://aspalliance.com/articleViewer.aspx?aId=650&pId=2
http://www.devx.com/codemag/article/16762/0/page/3
http://www.15seconds.com/issue/020312.htm
http://www.code-magazine.com/article.aspx?quickid=0307071&page=1
