Impersonate a user

S

Sorin Sandu

I am trying to impersonate the windows account in code like in
http://support.microsoft.com/default.aspx?scid=kb;en-us;306158 and then all
aspx pages to run on this new account (ACL on files is only for this
account).
But after the first page when I impersonate it and I redirect to another
page the account reverse to original.
How can I do to maintain impersonation but in code not in web.config.
 
P

Paul Glavich [MVP - ASP.NET]

How are you doing the redirect? If its using Response.Redirect then the
impersonation context will be lost (which is what I am assuming you are
doing). You can get around this by probably doing a Server.Transfer or
Server.Execute on the page while in the context of the impersonated user.
Once the response goes back to the client, you will lose that impersonation
context though.
 

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top