I'm working on a simple ASP.Net page (handler, actually) where I check the value of the LOGON_USER server variable. This works using Visual Studio's built-in web server and it works in other sites deployed to the live intranet site. But it doesn't work on the IIS instance on my local XP machine. How can I fix it, or what's going on if I can't?
+2
A:
What authentication do you have enabled in IIS? Anonmyous, Basic, Digest, Integrated Windows? Sounds to me like anonymous access is enabled/allowed, and nothing else. This would means that LOGON_USER is not populated.
When you access your local IIS, trying using http://127.0.0.1 in particular if you use IE. IE will recognize "localhost" as being in your local trusted zone and will automatically pass your XP login credentials through when Integrated Windows auth is enabled.
Jon
2008-09-12 21:13:13
That did the trick. It seems odd that it worked by default for Visual Studio's built in web server, though.
Joel Coehoorn
2008-09-12 21:19:05
I cannot definitively tell you why. I can only say that WebDev.WebServer.exe is meant to be a a stripped down HTTP server. It doesn't offer all of the same authentication options, etc. So it wouldn't surprise me that it uses integrated auth only. What about if you use firefox, same result?
Jon
2008-09-13 04:00:48
Firefox is setup as my default testing browser in VS
Joel Coehoorn
2008-09-15 12:53:28
A:
In addition to Jon's answer, IIRC even if you have Integrated Authentication enabled, if Anonymous Authentication is enabled it will take precedence...
CJM
2008-09-15 14:10:04