Impersonating IIS User in Global.asax methods

From: Richard Szalay (cozmo@bigpond.net.au)
Date: 12/17/02


From: cozmo@bigpond.net.au (Richard Szalay)
Date: 17 Dec 2002 14:06:20 -0800


Hi all,

I am attempting to impersonate as the IIS user in the Global.asax
methods (specifically, Application_Start). I am aware that ASP.NET
impersonation (configured in web.config) is done AFTER the Global.asax
methods are called.

Eg.
In an executing aspx page:
System.Security.Principal.WindowsIdentity.GetCurrent().Name ==
"THISCOMPUTER\MyWebUser"

In the global.asax:
System.Security.Principal.WindowsIdentity.GetCurrent().Name ==
"THISCOMPUTER\ASPNET"

Is it possible for me to manually do what ASP.NET does later on with
impersonating the IIS user (without hardcoding/storing the
username/password) ?

Any help would be greatly appreciated.

Cheers

Richard



Relevant Pages

  • Impersonation - as a specific user for all requests
    ... I'd like to impersonate all requests as a specific domain user. ... I want all requests to impersonate the same domain username/password. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Problem with DTS package
    ... as the username/password, for the impersonated account, is for now in plain ... text in the executable (for testing purposes -- note: the account only works ... the impersonate object and the repository object will populate it for me). ... >> Thanks for responding Scott, I have auditing on and checked the event ...
    (microsoft.public.dotnet.framework.aspnet)
  • Accessing the current logon information for a windows service
    ... I want to be able to query the current logon details for a windows ... username/password) for the account that a service runs under. ... to impersonate the user the service is running under. ... impersonation functionality but not the ability to get the user handle ...
    (microsoft.public.dotnet.security)
  • Re: Impersonation
    ... That sentence 'If you impersonate on the main ... around with trying to impersonate the logged-on user from your windows ... > change the process security context once a process is started. ... >> Richard. ...
    (microsoft.public.dotnet.framework)