470,586 Members | 1,379 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,586 developers. It's quick & easy.

Impersonating currently logged in user

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

Nov 17 '05 #1
1 2664
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.
"sushi" wrote:
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

Nov 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Marcin Zmyslowski | last post: by
7 posts views Thread by Jason | last post: by
7 posts views Thread by John | last post: by
1 post views Thread by accyboy1981 | last post: by
8 posts views Thread by simonlpwaters | last post: by
1 post views Thread by =?Utf-8?B?c3VidGlsZQ==?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.