Problem with retrieveing windows username


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Problem with retrieveing windows username

Hybrid View

  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)

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


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center