Re: Multiple Users with impersonation using one account
- From: Dominick Baier [DevelopMentor] <dbaier@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 27 Dec 2005 14:23:21 -0800
Hi,
ok .-
the client identity is in Context.User
WindowsIdentity.GetCurrent() give you the account the process is running under - this account is used for resource access when no impersonation is enabled.
Any reason why you are running as SYSTEM?? This is generally not recommended because this is a very high privileged account - this is also not the default for ASP.NET under Windows 2000 -
i guess you made changes to the processModel element in machine.config.
You be able to access resources on remote machines, you have several options
a) configure your worker process to run under a specific account, this could be a domain account or a local account, with a mirrored counterpart on the remote machine
this will affect all applications on the server
b) you can set impersonation in web.config for a fixed identity using <identity impersonate="true" username="xx" password="xx" /> - this will only affect the current application
c) you can impersonate programmatically by using LogonUser / WindowsIdentiy.Impersonate
config vs. code
i would
a) lower the privileges of ASP.NET to the default (which is the ASPNET account) - if possible
b) use programmatic impersonation when needed
--------------------------------------- Dominick Baier - DevelopMentor http://www.leastprivilege.com
I am using Windows Server 2000, not sure which SP.
The following line displays NT AUTHORITY\SYSTEM
Response.Write(System.Security.Principal.WindowsIdentity.GetCurrent.Na me )
Which I am assuming is the current user. Yes, I do know what happens when I assume!
Thanks, Jeff -- Sent via .NET Newsgroups http://www.dotnetnewsgroups.com
.
- References:
- Prev by Date: Re: Multiple Users with impersonation using one account
- Next by Date: Re: Multiple Users with impersonation using one account
- Previous by thread: Re: Multiple Users with impersonation using one account
- Next by thread: Re: Multiple Users with impersonation using one account
- Index(es):
Relevant Pages
|
|