zoukankan      html  css  js  c++  java
  • 401

    使用Windows集成验证,不管使用IIS还是IIS express,当同一个域进行访问时,可能出现401错误,错误的处理办法:

    1. IIS(摘自MSDN的)

    IIS 7 was difficult for figuring out why i was getting the 401 - Unauthorized: Access is denied due to invalid credentials... until i did this...

    1.) Open IIS and select the website that 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 was that Negotiate was above NTLM. I assume that there was 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

    相应的IIS express你必须找到其配置文件:C:Usersv-xiaofzDocumentsIISExpressconfigapplicationhost.config

    然后设置如下:

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

    上面红色部分非常关键,出现401错误就是因为两个交换位置了

  • 相关阅读:
    洛谷P1043数字游戏
    luogu P1330 封锁阳光大学
    luoguP1242 新汉诺塔
    luogu P1892 [BOI2003]团伙
    luogu P3375 【模板】KMP字符串匹配
    luoguP1440 求m区间内的最小值
    luoguP2700 逐个击破
    luoguP2814 家谱
    luogu P1962 斐波那契数列
    P3379 【模板】最近公共祖先(LCA)
  • 原文地址:https://www.cnblogs.com/Jin-1007/p/3765157.html
Copyright © 2011-2022 走看看