mad*_*ora 7 authentication asp.net-mvc authorization web-config windows-authentication
我正在尝试从Web.config文件中的MVC5项目配置IIS身份验证设置.
这就是我所拥有的.我希望启用Windows身份验证并禁用匿名身份验证.
但是在IIS中发布我的包后,设置就是这样.
我还需要做什么才能在Web.config 中将匿名身份验证设置为已禁用?这不是<deny users "?"/>应该做的吗?
这里我们一步一步走:
打开Internet信息服务(IIS)管理器:
在任务栏上,单击“开始”,指向“管理工具”,然后单击“确定”。
Internet信息服务(IIS)管理器。
如果您使用的是Windows Vista或Windows 7:
双击管理工具,然后双击Internet信息服务(IIS)管理器。
或者您可以通过配置文件禁用:
<location path="Contoso">
<system.webServer>
<security>
<authentication>
<anonymousAuthentication enabled="false" /> <!--This line you need-->
<basicAuthentication enabled="true" defaultLogonDomain="Contoso" />
<windowsAuthentication enabled="true" />
</authentication>
</security>
</system.webServer>
</location>
Run Code Online (Sandbox Code Playgroud)
拒绝匿名用户访问整个网站:
<authorization>
<deny users="?" ></deny>
</authorization>
Run Code Online (Sandbox Code Playgroud)
希望能帮助到你;)
| 归档时间: |
|
| 查看次数: |
12235 次 |
| 最近记录: |