server variable AUTH_NAME

Results 1 to 2 of 2

Thread: server variable AUTH_NAME

  1. #1
    Join Date
    Dec 1969

    Default server variable AUTH_NAME

    Hi,<BR><BR>I&#039;m new to asp scripting and have the following question on a current intranet site. <BR><BR>Validing users and asigning permissions has been achieved by using request.servervariables("AUTH_NAME") within an asp script against an MS SQL DB as follows:<BR><BR>and sometable.SID = suser_sid(&#039;" & Request.ServerVariables("AUTH_NAME") & "&#039;) "<BR><BR>The colleague who developed this is no longer with us and we&#039;ve had a few problems with the permissions. Now this isn&#039;t a question about the problems, but rather that I&#039;m confused about the use of this server variable. We use IIS as the web server.<BR><BR>I read some info on and other sites which do not list "AUTH_NAME" as a enviroment variable. I also ran the following to list all servervariables available:<BR><BR>&#060;%@Language=VBScript%&#062; <BR>&#060;%<BR> For each name in request.servervariables<BR> response.write "&#060;b&#062;" & name & "&#060;/b&#062; - " & request.servervariables(name) & "<BR>"<BR> next<BR>%&#062;<BR><BR>I decided to replace AUTH_NAME with AUTH_USER and then LOGON_USER. AUTH_USER and LOGON_USER caused the SQL query to fail, yet I get correct values when the above script is run. <BR>If I run the following:<BR><BR>Response.Write request.servervariables("AUTH_NAME")<BR><BR>No value is displayed. So I suppose my question is how come AUTH_NAME seems to work where as AUTH_USER and LOGON_USER do not? Also any posts on sites I&#039;ve seen involving AUTH_NAME state this is a server variable of Apache.<BR><BR>Thanks for your help,<BR><BR>Neil

  2. #2
    Join Date
    Dec 1969

    Default RE: server variable AUTH_NAME

    I haven&#039;t used AUTH_anything, but I am writing an intranet app that authenticates users using LOGON_USER. LOGON_USER returns the user&#039;s logon name in this format:<BR><BR>LogonDomainUsername<BR><BR>However, I believe this will only be returned if the user is logged on to an NT domain username. You will also want to make sure that anonymous access is disabled on the server.<BR><BR>Since usernames are not case sensitive to the Windows, and string comparisons in VBScript and SQL are, you may want to use a UCase() or LCase() function in your query statement:<BR><BR>and LCase(sometable.SID) = Lcase(suser_sid(&#039;" & Request.ServerVariables("AUTH_NAME") & "&#039;)) "<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts