Re: WindowsPrincipal and aspnet user
- From: Dominick Baier [DevelopMentor] <dbaier@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 26 Jan 2006 15:52:30 +0000 (UTC)
Hi,
thats
Context.User.Identity.Name
--------------------------------------- Dominick Baier - DevelopMentor http://www.leastprivilege.com
I haven't been able to find a clear explanation on this one. Using Visual Studio 2005, on my test environment (windows xp) the following code returns the user who is logged into windows. However on the server (Windows 2000 server service pack 4) it returns the aspnet account. Both are set to disallow anonymous access and use Integrated Windows authentication. Any thoughts on how I can get the username of the person hitting the website would be great.
The problem goes beyond this in that I need to check and see if this user is part of a specific group on the machine, but my root cause seems to be that I am not getting the correct user in the first place.
WindowsPrincipal wp = new WindowsPrincipal(WindowsIdentity.GetCurrent()); string userName = wp.Identity.Name;
.
- Follow-Ups:
- Re: WindowsPrincipal and aspnet user
- From: Joe Kaplan \(MVP - ADSI\)
- Re: WindowsPrincipal and aspnet user
- References:
- WindowsPrincipal and aspnet user
- From: william_dudek
- WindowsPrincipal and aspnet user
- Prev by Date: Re: Single Sign On - from anywhere
- Next by Date: Re: Single Sign On - from anywhere
- Previous by thread: WindowsPrincipal and aspnet user
- Next by thread: Re: WindowsPrincipal and aspnet user
- Index(es):
Relevant Pages
|