Blog from Saravanan Arumugam

Let us talk about Technologies

Error message 401.2.: Unauthorized: Logon failed due to server configuration.

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.


27 responses to “Error message 401.2.: Unauthorized: Logon failed due to server configuration.

  1. Kelly Taber October 9, 2012 at 8:19 am

    I can not believe this. I have been looking for the answer for a week now and no one has mentioned this. Thank you so much.

  2. Jay October 26, 2012 at 2:06 pm

    Thanks for the post. You saved me a lot of time trying to run this down.

  3. Joel May 22, 2013 at 6:16 pm

    Wow… Some of the simple things take the longest to find… Much appreciated 🙂

  4. Searching For The Right An Alternative To A Brinks Home Home Security System June 8, 2013 at 5:58 pm

    You really make it seem so easy with your presentation but I find this topic to be actually something that
    I think I would never understand. It seems too complex and extremely broad for
    me. I’m looking forward for your next post, I’ll
    try to get the hang of it!

  5. sanjay September 9, 2013 at 2:48 am

    Really very-2 helpful….Thanks
    Sanjay Gupta

  6. Vivek Kumar October 17, 2013 at 10:56 pm


  7. MallaReddy November 14, 2013 at 2:26 am

    i will give. but any one access the website give their credentials as you said…

  8. Venkat January 28, 2014 at 4:38 am

    it worked, thanks a lot! nice blog.

  9. mahesh February 18, 2014 at 11:20 pm

    oh my godwhat a hell is this. i was finding solution for this error from last 3 days finally got the solution

  10. Jacek April 5, 2014 at 6:34 am

    It helped me

  11. Pete July 10, 2014 at 6:10 pm

    I tried your solution, but it’s still not working.
    Below is my web.config:

  12. Pedro Adão August 5, 2014 at 5:00 am

    thanks a lot! Thats it! =)

  13. KuttyNN August 13, 2014 at 5:17 am

    awosome.. simple and neat solution.. thanks

  14. sowmiya October 10, 2014 at 5:16 am

    great ..its wrk fine

  15. Kishor Kumar S Dor November 25, 2014 at 6:24 am

    Thank you for the solution.

  16. Pingback: Fix Error Erase Firmware Block Failed Errors - Windows XP, Vista, 7, 8

  17. rashmi February 20, 2015 at 6:00 am

    how did you get properties pane . can u pls show more steps

  18. Lee March 10, 2015 at 12:57 pm

    You fixed it for me, thanks.

  19. pankaj tiwari April 8, 2015 at 12:19 am

    I am trying this solution but on right click to the properties I am not getting all such fields rather instead of project properties it’s showing xml document??

  20. Jeramy Rutley February 9, 2016 at 5:21 pm

    I used your post to get a solution, but in reverse! I saw that our web.config (in a Sitefinity app) was not using Windows authentication, so once I disabled Windows Authentication from the Properties pane, it started to work!

  21. sst May 6, 2016 at 2:29 am

    Nice it fix my issue.

  22. SS June 17, 2016 at 1:25 pm

    Great!!! Thanks a lot…we have been wondering on it for long.

  23. Krishna Mohan Bandi June 21, 2016 at 11:29 pm

    Thanks a lot, this help me.

  24. pushpa October 20, 2016 at 9:33 am

    seriously!!! you are amazing. thanks a lottttt.. god bless you 🙂

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: