简体   繁体   English

身份验证模式和ASP.NET MVC中的WindowsAuthentication标记之间的区别

[英]Different between authentication mode and windowsAuthentication tag in ASP.NET MVC

In IIS 7, if application is configured using below section it is giving 401 error. 在IIS 7中,如果使用下面的部分配置应用程序,则会出现401错误。

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

And when below section is added, it is working fine. 并且当添加以下部分时,它工作正常。 So, do we need to have both sections in web.config. 因此,我们是否需要在web.config中同时包含这两个部分。

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

Yes. 是。 you need to turn off anonymous authentication. 您需要关闭匿名身份验证。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM