2

I am developing an Asp.Net MVC website using Windows Identity Foundation and STS website for authentication. it works fine as whenever a user tries to access a URL, it redirects to STS website if that session is not authenticated.

Now I want to add a page in the application which should be available without authenticating into the site. But I am unable to do that. I tried giving the following in web.config. Still it gets redirected to the STS website. Here i want to allow anonymous access to "Public" controller and all its actions.

<location path="Public">
<system.web>
  <authorization>
    <allow users="*" />
  </authorization>
</system.web>

It will be great if somebody can guide me with the solution.

Thanks

4

2 回答 2

0

看看这个示例应用程序。我们最终禁用了自动重定向并自己控制它。

更多关于它是如何工作的细节在这里

于 2010-07-07T04:16:56.423 回答
0

注意:我意识到这个答案晚了大约一年,但我想记录下来以备将来参考。

users 属性中的星号 (*) 指的是所有经过身份验证的用户。要允许匿名或未经身份验证的用户,应使用问号 (?),如下所示。

<location path="Public">
<system.web>
  <authorization>
    <allow users="?" />
  </authorization>
</system.web>
于 2011-07-19T15:06:03.450 回答