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.
LVL 3
Abdu_AllahAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

WMIFCommented:
if you put this code onto a page within that directory, does it show then?

<%
for each item in request.ServerVariables
    response.Write "<b>" & item & "</b> - " & request.ServerVariables(item) & "<br>"
next
%>

you should see the same value for "remote_user" also.
0
darkeryuCommented:
Hi:

you can use:
userName = Request.ServerVariables("logon_user")

but if your server is a member of domain your userName maybe include the domain name (like domain/userName)

thanks
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Abdu_AllahAuthor Commented:
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!!
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

Abdu_AllahAuthor Commented:
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
.
.
.
0
WMIFCommented:
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
0
Abdu_AllahAuthor Commented:
Actually I found th reason it is with: LOGON_USER and not LOGON_NAME !!
0
Abdu_AllahAuthor Commented:
Why there is no LOGON_NAME variable here! my server is Win 2003 server!
0
WMIFCommented:
good catch.  i dont think there is name on 2000 either.
0
Abdu_AllahAuthor Commented:
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?
0
WMIFCommented:
they should be forced to enter that by the authentication engine in iis.  are you using basic or integrated auth?
0
Abdu_AllahAuthor Commented:
I am using basic, I have changed to integrated auth and it works fine. thank you.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.