2013-07-24 38 views
0

在IIS 7中,如果應用程序使用下面的部分進行配置,則會發出401錯誤。ASP.NET MVC中身份驗證模式與windowsAuthentication標記的區別

<authentication mode="Windows" /> 
<authorization> 
    <deny users="?" /> 
</authorization> 

而當下面的部分添加時,它工作正常。所以,我們是否需要在web.config中包含這兩個部分。

<system.webServer> 
<security> 
      <authentication> 
       <anonymousAuthentication enabled="false" /> 
       <windowsAuthentication enabled="true" /> 
      </authentication> 
    </security>  
</system.webServer> 

回答

0

是的。您需要關閉匿名身份驗證。