到aspx页面匿名访问失败 [英] anonymous access to aspx page fails

查看:76
本文介绍了到aspx页面匿名访问失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用窗体身份验证一个网站。在大多数情况下,我的网站需要身份验证做任何事情。我的隐私声明页面是一个例外,必须是匿名用户访问。
该网页是一个文件夹中,我已经设置在web.config位置路径信息如下:

I've a web site that uses forms authentication. For the most part, my web site requires authentication to do anything. My privacy statement page is an exception and has to be accessible to anonymous users. The page is in a folder, and I've set the location path information in the web.config as follows:

<location path="about">
    <system.web>
         <authorization>
            <allow users="*"/>
        </authorization>
    </system.web>
</location>
<location allowOverride="true">
    <system.web>
        <authentication mode="Forms">
            <forms name="FDAuth" 
                   cookieless="UseCookies" 
                   protection="All" 
                   loginUrl="login.aspx" 
                   requireSSL="false" 
                   slidingExpiration="false"></forms>
        </authentication>
        <authorization>
            <deny users="?"/>
        </authorization>
    </system.web>
</location>

这配置允许其他文件类型匿名访问,但仍提示输入登录的aspx页面。

That configuration allows anonymous access to other file types, but still prompts for a log in for aspx pages.

在换句话说,允许匿名访问此页

In other words, anonymous access is allowed to this page

www.mywebsite.com/about/privacy.asp

www.mywebsite.com/about/privacy.asp

但我去到Login.aspx页,如果我尝试访问访问该页面

but I go to the login.aspx page if I try to access access this page

www.mywebsite.com/about/privacy.aspx

www.mywebsite.com/about/privacy.aspx

什么我需要做的,允许匿名访问
www.mywebsite.com/about/privacy.aspx?

What do I need to do to allow anonymous access to www.mywebsite.com/about/privacy.aspx?

推荐答案

只是删除​​&LT;位置有的allowOverride =真正的&GT; 元素和配置&LT;授权/&GT; &LT;的System.Web /&GT;

just remove the <location allowOverride="true"> element and configure <authorization/> within <system.web/>

&LT;地点&gt; 标签用于定义例外全球政策,这通常是在中所定义;授权/&GT; &LT;的System.Web /方式&gt;

<location> tags are used to define exceptions to the global policy, which is typically defined in the <authorization/> within <system.web/>.

这篇关于到aspx页面匿名访问失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆