Link to home
Start Free TrialLog in
Avatar of Abdu_Allah
Abdu_Allah

asked on

Why Request.ServerVariables("LOGON_NAME") is empty!

Hi, I authenticated our web page through NTLM but when I try to retrieve Request.ServerVariables("LOGON_NAME") it is empty, IIS is confugured correctly and anonymous login is disabled.
Did I miss something? Why Request.ServerVariables("LOGON_NAME") is empty!

Please help.
SOLUTION
Avatar of WMIF
WMIF

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Abdu_Allah
Abdu_Allah

ASKER

WMF, this is very strange, Your code successfully print out the LOGON_NAME user! but why my code did not!

Here is my code:
DomainAndUser = Request.ServerVariables("LOGON_NAME")
response.write DomainAndUser

It does not print anything!!
Here is some of what your code printed out:
.
.
.
LOGON_USER - administrator
REMOTE_ADDR - 127.0.0.1
REMOTE_HOST - 127.0.0.1
REMOTE_USER - administrator
.
.
.
that is very interesting!  lets try directly writing on _your_ page without assigning the value to a variable.

so your code:
DomainAndUser = Request.ServerVariables("LOGON_NAME")
response.write DomainAndUser

change to:
response.write Request.ServerVariables("LOGON_NAME") & "<br>"
DomainAndUser = Request.ServerVariables("LOGON_NAME")
response.write DomainAndUser
Actually I found th reason it is with: LOGON_USER and not LOGON_NAME !!
Why there is no LOGON_NAME variable here! my server is Win 2003 server!
good catch.  i dont think there is name on 2000 either.
Actually darkeryu wrote it but I did not see it.

Well, I need to retrieve domain name if the user did not enter it in the user name edit box in this format(Domain\user name) I cannot retrieve it...how can I force the users to enter the format: Domain\user name?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I am using basic, I have changed to integrated auth and it works fine. thank you.