views:

74

answers:

3

I have been trying to configure a small website on a Windows Server 2008 running IIS 7. Unfortunately, when trying to load the website I keep getting the error: Server Error 401 - Unauthorized: Access is denied due to invalid credentials.

The permissions on the website folder include read, write, and execute for user ASP.NET v4.0. I even clicked "Check names" before adding the user to folder, to make sure that I spelled everything correctly. But the error continues to show. Also, I noticed that everything works okay if I add "Users" to the permissions for the folders containing the website, but I don't see why this should be necessary. I only want to give ASP.NET v4.0 access to the folder.

Some other noteworthy points include that I'm using the ASP.NET v4.0 application pool, that the managed pipeline is integrated, and that load user profile is set to true.

If anyone has any ideas, I'd appreciated the help. I'm stumped!

EDIT: Does it matter that the website is on the d: drive? I just assumed this wasn't important...

A: 

I find I always need to give IIS_IUSRS access.

Oren Mazor
@Oren. Thanks Oren. I tried adding IIS_IUSRS permissions (read, write, and execute) to the websites folder, but it produces the error. It must be a more specific user group than Users, I guess.
Andrew
@Oren. Okay Oren, you got this one. You were really close! The user that I had to grant permissions to was IUSR: http://forums.iis.net/p/1163005/1948756.aspx#1948756
Andrew
A: 

I'd recommend you to use the Process Monitor to detect which user is actually accessing the file.

Here you'll find an explanation about how to achieve that.

Claudio Redi
@Claudio. Thanks for the links! I tried running ProcMon, but there were too many rows in the window for me to judge which ones corresponded to my hitting the site. I filtered out everything but internet explorer, and then tried narrowing down the path of the application (not sure if this was the right thing to do, but I picked the path that IE runs from when it's started on the server)... I think I need more practice with Process Monitor...
Andrew
A: 

Open IIS7 on the server. Highlight the site, and double-click on the Authentication icon in the Security Section. Check that Anonymous Authentication is enabled.

Some troubleshooting links for this particular issue:

http://support.microsoft.com/kb/902160

http://support.microsoft.com/kb/907273

IrishChieftain
It is indeed enabled. Actually, it's the only item that's enabled...
Andrew
Did you add full permissions on the site folder for the "NETWORK SERVICE" account? Also, try setting "load user profile" to false - is the some reason you have this set to true?
IrishChieftain
@Mr. Chieftan - Sorry for the late response (went to sleep last night...) Using Network Service didn't seem to have any additional effects. I also tried the suggestion about setting "load user profile" to false, but to no avail... I'm going to research this Authentication icon in the security section a little more...
Andrew
@Mr. Cheiftan - I just wanted to give you kudos for being on the right track. It turns out that if I click "Edit" in the right-hand pain while highlighting "Anonymouse Authentication", I can then select ApplicationPoolIdentity instead of using the user IUSR. This is probably the best way to allow asp.net to authenticate in IIS 7. Thanks again for your help!
Andrew
@Mr. Chieftan - PPS - I can't believe that IUSR was configured in the first place. What in the world?!?
Andrew
Glad you got it resolved :-)
IrishChieftain