Click to See Complete Forum and Search --> : request.servervariables("auth_user") not working


sathysudha
08-31-2003, 05:06 AM
Hi guys

i tried to get the username of the machine.
response.write request.servervariables("auth_user") is give only empty.
why its not giving the username?
what settings i have to give thru the IIS?
kindly help me in this regarding.

thanks
sudhakar

PeOfEo
09-04-2003, 07:11 PM
You are using asp? Or asp.net?

sathysudha
09-06-2003, 12:38 AM
I am using ASP

PeOfEo
09-06-2003, 01:02 AM
I wish I could help you more but I don't know asp classic, but the syntax is very similar to that of asp.net which is what I use, I can take a stab at this maybe . You are trying to get the user name for someone who is logged onto the server, and it is giving you a null value. You are logged onto the machine and have a userid when you test this correct?

Superfly1611
09-11-2003, 03:22 AM
I've just had that exact same problem.

For some reason it wont allow you to response.write() your auth_user variable.
But it does allow me to use it in logic (if statements etc)

eg:


<%

Dim user
user = request.servervariables("AUTH_USER")

If user = Superfly1611 then

response.write("Hey Dude")
Else
response.write("Who the hell are you?")
End If

%>


Notice that there are no quotation marks around the username... took me a while to figure that one out aswell!

I don't know if this helps or not but i thought i'd let you know anyhow

Cheers

Superfly1611

Superfly1611
09-11-2003, 04:50 AM
forgot to mention...

you also need to make sure that your ISS is setup with annonymous access UNchecked and if not already done so NT Challenge/Windows Authentication Checked.

XRaheemX
11-02-2006, 04:03 PM
I know this is an old thread, but I just wanted to make a note as to why I believe your script here worked:

Dim user
user = request.servervariables("AUTH_USER")
'At this point "user" is "undefined"

'your comment about having to take the double quotes off of Superfly1611
'makes me believe that this is what is happening. With Superfly1611 being
'unquoted, it is acting like yet another variable and is therefore also
'"undeifned". So when you compare undefined to undefined, it makes it
'thorugh the TRUE block!!! You can test this theory by putting:

If user = FGSRGHSDRTHESRHESRTHH then

'This should still work



:)

I've just had that exact same problem.

For some reason it wont allow you to response.write() your auth_user variable.
But it does allow me to use it in logic (if statements etc)

eg:


<%

Dim user
user = request.servervariables("AUTH_USER")

If user = Superfly1611 then

response.write("Hey Dude")
Else
response.write("Who the hell are you?")
End If

%>


Notice that there are no quotation marks around the username... took me a while to figure that one out aswell!

I don't know if this helps or not but i thought i'd let you know anyhow

Cheers

Superfly1611

Jonsey
02-14-2007, 02:16 PM
This should right it out for you

<%Response.Write(Request.ServerVariables("AUTH_USER"))%>