Library code snippets

Determining the logged-on user from ASP

If you're using Basic or NT Challenge/Response security for access to 
your Web site, you can programmatically determine which user is 
accessing a page at any given time. To do so, simply interrogate the 
value of the following:

request.serverVariables("LOGON_USER")

Note that, by definition, you'll simply get back an empty string if 
you're using anonymous security on your Web site.

Comments

  1. 30 Nov 2005 at 19:00

    Hi, when I use server variable for retrieve username I get empty string when I turn off anonymous access off I get this error (This is usually caused by a server-side script not sending the proper WWW-Authenticate header field. Using Active Server Pages scripting this is done by using the AddHeader method of the Response object to request that the client use a certain authentication method to access the resource.)

  2. 14 Jan 2004 at 23:10

    Is it possible to use ASP 3.0 on IIS to logon the user under windows challenge response. That is ASP logs on the user - so the user doesn't have to participate in the challenge response?


    I'm installing element K on a windows NT server and am using certificates to authenticate users from another system. LDAP isn't yet available.  I can use session variables and the like to controlaccess to pages but not objects (eg. shockwave files) in the directory. What I'd like to do is lock down or unlock access to the whole directory for each user in asp using a logon page outside the directory.


    Any help would be appreciated ...

  3. 14 Jan 2004 at 23:09

    Is it possible to use ASP 3.0 on IIS to logon the user under windows challenge response. That is ASP logs on the user - so the user doesn't have to participate in the challenge response?


    I'm installing element K on a windows NT server and am using certificates to authenticate users from another system. LDAP isn't yet available.  I can use session variables and the like to controlaccess to pages but not objects (eg. shockwave files) in the directory. What I'd like to do is lock down or unlock access to the whole directory for each user in asp using a logon page outside the directory.


    Any help would be appreciated ...

  4. 17 Aug 2003 at 09:31

    Hi,
    How can I determine the logged-on user on my test environment. I've locally installed on NT Apache 1.3.x, ColdfusionMX. If I'm using CGI.AUTH_USER I get always an empty string. What can I do to get the logged-on user even I've no domain in my test environment.


    Thanks for help

  5. 06 Jun 2003 at 00:24

    To get the ID of a user on an Intranet where access is managed through domain rights, take away all priviledges that the IUSER account has to that web or subweb, then access the identity servervariables to get the user ID (one of USER, AUTHUSER, LOGON_USER).

  6. 06 Jun 2003 at 00:24

    To get the ID of a user on an Intranet where access is managed through domain rights, take away all priviledges that the IUSER account has to that web or subweb, then access the identity servervariables to get the user ID (one of USER, AUTHUSER, LOGON_USER).

  7. 01 Jan 1999 at 00:00

    This thread is for discussions of Determining the logged-on user from ASP.

Leave a comment

Sign in or Join us (it's free).

AddThis

Related discussion

Related podcasts

  • ASP.NET Caching and Performance

    Steve Smith, owner of ASP Alliance and Lake Quincy Media joins us today to teach us about some hidden gems in ASP.NET caching and performance. Steve’s expertise in this area comes from first-hand experience as Lake Quincy’s ad system serves over 60 requests per second and handles over 150 million...

Related jobs