Re: Impersonate a user

From: Paul Glavich [MVP - ASP.NET] (glav_at_aspalliance.com-NOSPAM)
Date: 08/16/04


Date: Mon, 16 Aug 2004 22:21:02 +1000

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.

-- 
- Paul Glavich
Microsoft MVP - ASP.NET
"Sorin Sandu" <ssandu@yahoo.com.del> wrote in message
news:e3HNCj1gEHA.644@tk2msftngp13.phx.gbl...
> 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.
>
>


Relevant Pages

  • Re: Going from anonymous security to Windows Security in an ASP.NET application
    ... as I said in my previous post - there is no context on the client... ... Your page.context exists purely on the server. ... we need to have our own login page instead of the standard Windows logon ... impersonation, which takes place on the server has no effect on page ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • RE: Impersonate a user
    ... send another request for the new page, all the previous state, including your ... > aspx pages to run on this new account (ACL on files is only for this ... > But after the first page when I impersonate it and I redirect to another ... > How can I do to maintain impersonation but in code not in web.config. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: defaultNamingContext property failing in asp.net
    ... thanks for the info Joe. ... anonymous user and when we set impersonation true for the aspx page then it ... > context isn't a domain account, ... > anonymous user in AD and don't have any permissions to see any objects. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: To obtain Web Service security context
    ... > self") and then undoing the impersonation context to start the ... >> need this to do a trusted connection to SQL Server. ... >> The current settings for the ASP.NET app are windows authentication and ... >> be in the context of the current user which I don't want. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: How to Stop a Service From Impersonating Other Users
    ... as I may to some minds have overstated things ... as another account, in the published API, was for a log in to happen. ... context, it is sensible to term what had been done as impersonation, ...
    (microsoft.public.windows.server.security)