a blog for those who code

Wednesday 24 May 2017

How to solve Unauthorized Logon failed due to Server Configuration

In this post we will be discussing about solving Error Message 401.2: Unauthorized: Login failed due to server configuration. This error is very frequent when you are trying to create a Intranet MVC Application. You will get Server Error and it will throw Access is denied Error as shown below.

Server Error in '/' Application. 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.

To solve this error you need to follow the below instructions :

1. Click on your project in the Solution Explorer to select the project.
2. If the Properties pane is not open, open it using F4.
3. In the Properties pane for your project:
   a) Set "Anonymous Authentication" to "Disabled".
   b) Set "Windows Authentication" to "Enabled".

You also need to check that your web.config should have the below line

<authentication mode="Windows" />

After this build your project again and run it, the Error will be gone. Happy Coding !!!.

Please Like and Share the Blog, if you find it interesting and helpful.

1 comment:

  1. If I do as suggested above, I keep getting a window "Authentication required", no matter how I log in.