IIS7.0:如何在IIS中仅启用“匿名身份验证”

时间:2016-05-05 05:25:27

标签: asp.net authentication iis

我想在IIS 7.0中仅使用配置文件(web.config)中的更改启用“匿名身份验证”。我们正在进行wcf服务的打包,我们希望禁用所有身份验证模式,只想启用“匿名身份验证”。是否可以通过web.config并且不使用IIS用户界面来完成。

我尝试过以下代码,但它无效:

<authentication mode="None" />
<authorization>
  <allow users = "?" />
</authorization>

**ignore typos

1 个答案:

答案 0 :(得分:0)

您可以通过在web.config的<system.webServer>标记中添加以下 child 标记来实现此目的:

<security>
  <authentication>
    <anonymousAuthentication enabled="true" />
    <basicAuthentication enabled="false" />
    <digestAuthentication enabled="false" />
    <windowsAuthentication enabled="false" />        
  </authentication>
</security>

我假设匿名是此Web应用程序所需的唯一身份验证模式。

为使这些web.config设置生效,应在IIS服务器级别上设置身份验证设置委派。

选择IIS服务器节点,然后选择“功能委托”,并确保所有类型的身份验证均处于“读取\写入”委托模式:

enter image description here

enter image description here

相关问题