DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Iain Munro Guest

    Problem with retrieveing windows username

    Hi,

    I'm atttempting to retrieve the Windows username from an
    ASP page using the WindowsIdentity.GetCurrent() method. The object returns
    but the username contained is 'NT AUTHORITY' as opposed to the correct
    windows username.

    Any ideas?

    Iain



  2. #2
    Paul Clement Guest

    Re: Problem with retrieveing windows username

    On Mon, 7 Jan 2002 12:02:19 -0000, "Iain Munro" <imunro@genre.com> wrote:

    ¤ Hi,
    ¤
    ¤ I'm atttempting to retrieve the Windows username from an
    ¤ ASP page using the WindowsIdentity.GetCurrent() method. The object returns
    ¤ but the username contained is 'NT AUTHORITY' as opposed to the correct
    ¤ windows username.
    ¤

    I believe it is an impersonation issue that ASP does automatically but ASP.NET does not (by default)
    when requested. See if the following helps/makes sense:

    The Web server impersonates a client in one of two ways. Original ASP automatically impersonated the
    client every time a request was made. ASP.NET does not do this by default, but you can turn it on in
    the web.config file by setting the impersonation attribute to True. Alternatively, you can
    impersonate the client programmatically by calling the function
    System.Security.Principal.WindowsIdentity.GetCurrent().Impersonate.

    Web.config settings for automatic impersonation.

    <identity>
    <impersonation enable="true" />
    </identity>


    Paul ~~~ pclement@ameritech.net
    Microsoft MVP (Visual Basic)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links