Tuesday, August 30, 2011

Error message in IIS 7.5: HTTP Error 401.2 – Unauthorized

IIS is really great. But sometimes you get an error message without any clue how to fix it. When I was testing an ASP.NET MVC website on my Windows 7 64-bit machine, I got the following error:

HTTP Error 401.2 – Unauthorized

You are not authorized to view this page due to invalid authentication headers.

After trying to change almost every possible setting in IIS I finally found the root cause of the issue. My default installation of IIS was running without the Windows Authentication module installed. As my website was expecting windows authentication, it was not unexpected to see this error. After enabling this feature in the list Windows Features, everything worked!



Valentino Vranken said...

Hey Bart,

So you're not reading my blog anymore then? Otherwise the following post would have saved you some time and frustration: http://blog.hoegaerden.be/2010/02/14/iis-7-5-and-windows-authentication/



Alex Paul said...

I faced the same problem and I got solution from: http://www.microsoftsupportchat.com/blog/post/Error-code-401.2/

Goge said...

Thank you very much!