Asp Net 401 Error
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads asp net 404 error with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack asp net 403 error Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign asp net 500 error up “401 Unauthorized” on a directory up vote 36 down vote favorite 15 I assume this is an IIS error, as this doesn't happen if I run the project on my local machine. I have my stylesheets at ~/Content/css Any files
Asp Net 401 Unauthorized
in that directory won't load on the page, and when I navigate to them directly, I get a server 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. This only happens with that directory, I have no problem accessing any other files. Is there something I need to do in IIS7 to stop this? asp.net asp.net-mvc iis iis-7 share|improve this question asked Jun 22 '12 asp net 411 at 18:53 Steven 5,47440128211 add a comment| 4 Answers 4 active oldest votes up vote 23 down vote accepted It is likely that you do not have the IUSR_computername permission on that folder. I've just had a quick scan and it looks like you will find the information you need here. If that isn't the case, are you prompted for your username and password by the browser? If so it may be that IIS is configured to use Integrated authentication only, as described here. share|improve this answer answered Jun 22 '12 at 19:10 m.edmondson 17k1475145 2 If you're using an application pool to manage your db/file system access, don't do this. Read on to see imanabidi's answer below. –Ryan Shillington May 2 at 4:27 add a comment| up vote 116 down vote Open IIS and select site that is causing 401 Select Authentication property in IIS Header Select Anonymous Authentication Right click on it, select Edit and choose Application pool identity Restart site and it should work share|improve this answer edited Dec 16 '14 at 6:59 imanabidi 6,99343747 answered May 14 '14 at 22:30 jasenkoh 1,6582919 8 It works but why? Can you explain a little bit more? –nthapa13 Nov 27 '14 at 6:56 This appears to work because, by default, the "specific user" for the anonymous authentication is IUSR, as mentioned in the accepted answer. However, the identity set on the application pool must have permissions to the entire website, or the sit
house on my laptop (perhaps if we see sunshine this summer that might even be outside!). Anyway, after basking at my success, things quickly went wrong. Aside from moaning about Homegroup http://www.codepal.co.uk/show/ASPNET_401_Unauthorized_errors_with_IIS75 stopping working after a few log-ins, I came upon a rather serious problem with IIS 7.5 on Windows 7. When I ran the web sites on my machine locally (e.g. via LOCALHOST), only the ASPX files and AXD files would display. Everything else was blocked with a 401 Unauthorized error (I found this out using Firebug): The worst thing about this error was the lack of solutions asp net in the Googlesphere. Digging into the IIS Log Files, I found that the error was in fact 401.3, which can result from corrupt permissions (or permissions that do not align to the Windows Access Control List). Anyway, to cut a long story short, here's how to fix it: Right-click on each web site folder and click Properties Select Security > Edit If IUSR or IIS_IUSRS is listed, select and asp net 401 Remove them Then click Add and select the IUSR and IIS_IUSRS entries Provide each of the above with Read and Read & Execute permissions Restart IIS Comments No comments have been posted. Be the first to write a comment... Post a Comment New Comment Name (required): The name field cannot be blank Your web site (optional): The web site URL is not in the correct format (also include http: prefix!) Email (optional): The email address is not in the correct format 5 + 7 = This is to prove that you are not a spam robot posting links to dodgy sites! The result should be numeric! Comment (required): The comment field cannot be blank This web site is intended for information only. All information provided comes with no warranty or guarantee. Please do not reuse this content without prior permission, you know it makes sense. Powered by CodePalCMS © David Clough 2016 Privacy Policy If this content saves you time or money, please consider returning a favour by... Leaving a comment to let me know... Donate your idle processor power to help cure diseases (its free and easy)... World Community Grid Donating the cash you've saved to someone who really needs it...