impersonate in global.asax.cs instead of page load

From: Ed leNoir (EDLENO@safeco.com)
Date: 10/31/02


From: EDLENO@safeco.com (Ed leNoir)
Date: 30 Oct 2002 21:32:48 -0800


I thought I could do an Impersonate in a global event but it doesn't
seem to work. By the time the page loads the current identity is back
to the default value. I can do the impersonate in the page load event
and everything works.

The Microsoft samples also use page load, but I thought doing the
impersonate in BeginRequest would do the trick.

At what point is the thread created for a page/request? I'd like to
centralize the code in the global.asax.cs. Page load can work too, but
it just seems it should work as an application event.

(I've also tried the SetThreadIdentity in ApplicationStart (and
BeginRequest) but neither of those worked. )

- Ed



Relevant Pages

  • RE: impersonate in global.asax.cs instead of page load
    ... It might work to put impersonation in an httpModule. ... >I thought I could do an Impersonate in a global event but it doesn't ... I can do the impersonate in the page load event ... >impersonate in BeginRequest would do the trick. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Reading keys from HKEY_CURRENT_USER from an impersonated Web Service
    ... impersonating does not load the profile of the impersonated user. ... "accounts" that are logged in interactively (called an interactive session) ... impersonate different users, and it's extremely unsafe to load a users ...
    (microsoft.public.dotnet.languages.csharp)