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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top