IIS 7.5 Virtual Directory getting Unauthorized: Access is denied due to invalid credentials

Scottie picture Scottie · Jul 21, 2011 · Viewed 8.2k times · Source

I have a web application that is trying to access images from a shared folder on a different server.

In my web app, I created a new virtual directory. The alias is QCPhotos and the path is \alta\QCPhotos. Alta is a different server than my web server, which is Brighton.

I am getting the error:

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.

In trying to debug, on the Alta server, I have given the Everyone user full access to this folder. I also gave {domain}\Brighton$ full access to the folder.

I turned on Directory Browsing, and that seems to work fine. I can list the contents of the folder, but as soon as I click on a jpg image, this error comes up.

Answer

Scottie picture Scottie · Jul 21, 2011

Well, I'm still not sure why it wasn't letting me access, but I created a domain user acct named QCPhotos. I gave that user read permissions on the folder, and then set the virtual directory to use this user in IIS. This fixed my problem.