在单个位置禁用Windows身份验证

时间:2011-03-07 16:55:33

标签: asp.net iis iis-7.5

我有一个Web应用程序,我想提供对其中几个Web服务的匿名访问,这样我们就可以在没有Windows登录的情况下从计算机访问Web服务。

我在这里尝试过这些东西Disable authentication on subfolder(s) of an ASP.NET app using windows authentication。我做到了这一点:

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

...

  <location path="Tests/QService.asmx">
    <system.web>
      <authorization>
        <allow users="?" />
        <deny users="*" />
      </authorization>
    </system.web>
  </location>

这两者都“起作用”,因为它们允许匿名用户访问Web服务。但是,似乎IIS仍然发送授权挑战,因为当我从浏览器访问服务时,我得到一个框来输入我的用户名和密码。如果我点击取消,我会匿名访问该页面。但是,我们的一些客户端不能很好地处理这个问题,因为401返回代码而失败。

有没有办法在该单一位置完全禁用Windows身份验证,以便IIS不会尝试建立Windows身份验证?

1 个答案:

答案 0 :(得分:5)

您需要在虚拟目录上为该单个位置禁用Windows身份验证。那你不应该被挑战。