401-unauthorized:access is denied due to invalid

Source: Internet
Author: User

With Windows Integrated authentication, regardless of whether IIS or IIS Express is used, a 401 error may occur when accessing the same domain, with the wrong approach:

1. IIS (excerpted from MSDN)

IIS 7 was difficult for figuring out why I am getting the 401-unauthorized:access is denied due to invalid credentials ... until I did this ...

1.) Open IIS and select the website is causing the 401

2.) Open the "Authentication" property under the "IIS" header

3.) Click the "Windows Authentication" item and click "Providers"

4.) For me the issue is that Negotiate is above NTLM. I assume that there is some kind of handshake going on behind the scenes, but I was never really authenticated. I moved the NTLM to the top most spot, and BAM that fixed it.

2.IIS Express

The corresponding IIS express you must find its configuration file:C:\Users\v-xiaofz\Documents\IISExpress\config\applicationhost.config

Then set the following:

<authentication>

<anonymousauthentication enabled= "false" Username= ""/>

<basicauthentication enabled= "false"/>

<clientcertificatemappingauthentication enabled= "false"/>

<digestauthentication enabled= "false"/>

<iisclientcertificatemappingauthentication enabled= "false" >
</iisclientcertificatemappingauthentication>

< windowsauthentication enabled= "true" >
< providers>
<add value= "NTLM"/>
< add value= "Negotiate"/>
</providers>
</windowsauthentication>

</authentication>

The red section above is critical, with 401 errors because of the two switching positions.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.