Sometime, we get this error message after publishing the solution in IIS. This error is quite common.

Exact Error

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.

This particular error happens mostly because of authentication setting in IIS.

Solution:

Open the IIS.

Select the site you are facing issue.

Select Authentication Setting as shown

Based on your application requirement, you can update authentication options

In my case, the application needs to set windows authentication, therefore, I set it enabled and Anonymous Authentication Disabled.

Regards

By Rijwan Ansari

MVP, CSM, CSPO, MCP, MCTS. Sr. Software Developer. Expertise in ASP.NET MVC, Angular, AngularJs, .Net Core, C#.NET, Azure, Cognitive Services, Machine Learning, SharePoint, Azure Services, and tools, Requirement Analysis, Team Management, Pre-Sales and more. Ability to work independently and Team, handle pressure and meet commitment. Excellence Communication and adjust in any environment

Leave a Reply

Your email address will not be published. Required fields are marked *