Re: WindowsPrincipal and aspnet user



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;


.



Relevant Pages

  • Re: Zeitpunkt der aktuellen Windows-Anmeldung
    ... Die WMI-Klasse 'Win32_LogonSession' (ab Windows XP) besitzt eine Eigenschaft ... ActiveDirectory: ... using System.DirectoryServices.Principal; ...
    (microsoft.public.de.german.entwickler.dotnet.csharp)
  • WindowsPrincipal and aspnet user
    ... Visual Studio 2005, on my test environment (windows xp) the following ... (Windows 2000 server service pack 4) ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • RE: resolving second logon name
    ... that represents the current Windows user. ... it depends if you are using Microsoft Exchange ... | Content-Class: urn:content-classes:message ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Newbe GP
    ... I have a windows 2000 advanced server and a windows 2000 pro machine in a ... test environment. ... I added a user called gptest1. ...
    (microsoft.public.win2000.group_policy)
  • Cannot view a mailbox folder and reset password of users problem
    ... windows 2000 server service pack 4 ... and i immediately change the outlook express 's ... However, when i change the outlook express's with old password, it can ...
    (microsoft.public.exchange.admin)