authenticationasp-classic

Classic ASP Request.ServerVariables("LOGON_USER") returning wrong username


Classic ASP Request.ServerVariables("LOGON_USER") is returning wrong username. Here is the scenario:

I have two accounts on the domain, one for administration and one for normal use. The admin account is set as admin (in the Administrators group) on the server where the ASP script is running on. Server is Windows 2003 running IIS 6.0.

I log in to my machine with my normal user account and go to the page and it is returning my admin account user name. Why is this happening ? This works fine for others.

<%
Response.Write "LOGON_USER: " & Request.ServerVariables("LOGON_USER") & "<br>"
Response.Write "REMOTE_USER: " & Request.ServerVariables("REMOTE_USER") & "<br>"
Response.Write "AUTH_USER: " & Request.ServerVariables("AUTH_USER") & "<br>"
Response.Write "<br>"
'Show all server variables
For Each Item In Request.ServerVariables
Response.Write Item & " = " & Request.ServerVariables(Item) & "<br>"
Next
%>

Anonymous access is off and Windows authentication is on.

Thanks,

Jari


Solution

  • Underlying problem is probably the fact that I have $share open to the same server with the admin user name while having asp sessions on the same server with IE with the normal user.

    Changing user back to the normal one can be done from Control Panel --> User accounts --> Manage your passwords --> Select the server in question and change the user name to the correct one. No need to enter password. Ok, Close and Cancel. You might need to open a new IE for the change to take effect.

    This needs to be done every time the user changes 'behind the scenes'.