401-Access denied on new virtual folder in IIS using domain user for anonymous login
Posted on 2010-09-15
Two Windows 2008 R2 servers, one is web server, the other is database server with AD installed. A custom CGI app on the web server needs access to database files on the other server, so I've set it up to use a domain user rather than IUSR for anonymous user login for all newly created virtual folders.
Problem: I create a new virtual folder and check that anonymous user authentication uses my domain user MYDOMAIN\WEBUSER. The virtual folder itself is on the web server and it has full permissions assigned to both IUSR and to MYDOMAIN\WEBUSER. When I connect, I get
"401 - Unauthorized: Access is denied due to invalid credentials. You do not have permission to view this directory or page using the credentials that you supplied."
If I go to Authentication / Anonymous Authentication and set it to use IUSR, it will then open the web page in the virtual folder (I'm just using a test.html file for testing). However, if I immediately go back and set it back to MYDOMAIN\WEBUSER, where it was by default to start with, it then works!
That's the only thing I change to make it work - simply change from my domain user to IUSR and then right back again.