Populationg LOGON_USER servervariable

1.6k Views Asked by At

I have a classic ASP Web application that's been running on a Windows Server 2003 server with IIS 6.0 for several years. I have to move it to a Windows Server 2008 server with IIS 7.0. I've got it working, but the ServerVariable LOGON_USER doesn’t get populated. This seems to be because I have enabled Anonymous Authentication and allowed Anonymous Authorization to the site. However, if I disable/deny either of those, then I get an Authentication or Authorization error when attempting to open it. I have to have the LOGON_USER variable for the program to work correctly, but no matter what combination of Authentication/Authorization I use, I get errored out if I don't allow anonymous login. Rather at a loss at this point as to what to try next. Any suggestions?

1

There are 1 best solutions below

0
On

When you disable anonumous access, the site will become inaccessible for users that are not logged in.

You will need to add at least read-rights in Windows Explorer to the folder your web-application is running in. If you do that, IIS will then prompt you for a username and password. You can use the credentials of the user you have assigned read rights to.

This will then authenticate you as that specific user, and allow you to run the site. This will also fill the LOGON_USER servervariable with the username of the user you added.

Here's some more documentation on how to create a user for access using basic authentication in IIS:

http://technet.microsoft.com/nl-nl/library/cc772009%28v=ws.10%29.aspx
http://msdn.microsoft.com/en-us/library/aa292114%28v=vs.71%29.aspx
How do I create a user account for basic authentication?