W
william_dudek
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;
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;