Impersonating currently logged in user

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,
I am running a ASP.Net application. It runs by defaul in the context
of ASPNET user. I want to dynamically impersonate it so as to run in the
context of currently logged in user. I know it is possible by specifying
username, domain and password and using WindowsIdentity,
WindowsImpersonationContext classes. But I wanted to know whether it is
possible to achieve this by not passing username and password and system
taking the same from currently logged in user.

Thanks,
Sushi
 
What you have to do:

Disable anonymous access in IIS for your web-application.
in your web.config add the following line:
<identity impersonate="true" />

And you're done.
 
Back
Top