Disable windows authentication on single location

≡放荡痞女 提交于 2019-12-23 08:53:03

问题


I have a web application and I want to provide anonymous access to a couple of the web services in it so that we can access the web services from computers without a windows login on our network.

I've tried the stuff here Disable authentication on subfolder(s) of an ASP.NET app using windows authentication. I've done this:

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

...

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

These both "work" in that they allow access to the web service for anonymous users. However, it seems that IIS still sends an authorization challange because when I access the service from a browser I get a box to enter my username and password. If I hit cancel I get access to the page anonymously. However, some of our clients don't handle this well and just fail because of the 401 return code.

Is there a way to completely disable the windows authentication on that single location such that IIS will not try and establish a windows authentication?


回答1:


You need to disable Windows Authentication on the Virtual Directory for that single location. Then you shouldn't be challenged.



来源:https://stackoverflow.com/questions/5222556/disable-windows-authentication-on-single-location

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!