Error message 401.2.: Unauthorized: Logon failed due to server configuration.
March 22, 2012
Posted by on
I was trying to get my MVC 3 web application work through IIS 7.5 Express, and when I ran the application I got the following error.
Access is denied.
Description: An error occurred while accessing the resources required to serve this request. The server may not be configured for access to the requested URL.
Error message 401.2.: Unauthorized: Logon failed due to server configuration. Verify that you have permission to view this directory or page based on the credentials you supplied and the authentication methods enabled on the Web server. Contact the Web server’s administrator for additional assistance.
As the first step I had to look at the web.config. The authentication mode was set to Windows Authentication.
<authentication mode="Windows" />
<deny users="?" />
Even though the web.config says that I need windows authentication, IIS Express need to be informed about it.
To resolve it, I did the following.
1. Clicked on the Web Project, and hit F4. (Right click and properties will get you to a different place)
2. Made sure that I can see the Properties Pane. (Not the property window).
3. Select Enabled for the Windows Authentication Property.
This would enable the windows authentication and get rid of the exception.