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.

Exception

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.

 

Solution

As the first step I had to look at the web.config. The authentication mode was set to Windows Authentication.

    <authentication mode="Windows" />
    <authorization>
      <deny users="?" />
    </authorization>

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.

image

This would enable the windows authentication and get rid of the exception.

Advertisements

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. cro November 30, 2012 at 4:45 am

    Thanks a lot

    • aaron May 16, 2013 at 8:37 pm

      thanks a lot ….
      you save my day 🙂

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

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

  5. 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!

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

    Really very-2 helpful….Thanks
    Sanjay Gupta

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

    Awesome

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

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

    • MallaReddy November 14, 2013 at 2:27 am

      allow users=domainname\username i will give.but any one access the website give their credentials as you said…

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

    it worked, thanks a lot! nice blog.

  10. 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

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

    It helped me

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

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

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

    thanks a lot! Thats it! =)

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

    awosome.. simple and neat solution.. thanks

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

    great ..its wrk fine

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

    Thank you for the solution.

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

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

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

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

    You fixed it for me, thanks.

  20. 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??

  21. 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!

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

    Nice it fix my issue.

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

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

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

    Thanks a lot, this help me.

  25. 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:

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: