【问题标题】:IIS7.0 : how to enable only "Anonymous Authentication" in IISIIS7.0:如何在 IIS 中仅启用“匿名身份验证”
【发布时间】:2016-05-05 05:25:26
【问题描述】:

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

我尝试了以下代码,但它不起作用:

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

**ignore typos

【问题讨论】:

  • 这个问题不是Enable Anonymous Authentication的重复问题。该问题涉及应用程序中的单个文件夹,该问题询问整个应用程序。
  • 只有 IIS 管理员可以授予您在 web.config 中进行配置的可能性,因为默认情况下只能在 applicationHost.config 中进行配置,所以这个问题现在是无效的。
  • 虽然 OP 没有指定任何行政限制。

标签: asp.net authentication iis


【解决方案1】:

您可以通过将以下 child 标记添加到 web.config 的 &lt;system.webServer&gt; 标记来做到这一点:

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

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

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

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

【讨论】:

    猜你喜欢
    • 2014-09-30
    • 2019-01-09
    • 2020-12-21
    • 1970-01-01
    • 1970-01-01
    • 2016-01-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多