表单身份验证:始终要求登录匿名页面 [英] Forms authentication: always askse for login for anonymous pages

查看:138
本文介绍了表单身份验证:始终要求登录匿名页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在asp.net应用程序中使用表单身份验证。虽然有少量文件和文件夹需要匿名访问。为此我添加了部分。 
< system.web >
< 身份验证 mode = 表格 < span class =code-attribute> >
< < span class =code-leadattribute> forms name = .ASPXFORMS loginUrl = user / login.aspx 保护 = 所有 path = / timeout = 30 / >
< / authentication >

< 授权 >
< deny users = / <跨越ss =code-keyword>>
< / authorization >
< trust level = 完整 / >
< 编译 debug = true targetFramework = 4.0 / < span class =code-keyword>>
< customErrors mode = Off / >
< / system.web >

< location < span class =code-attribute> path = 搜索 >
< system.web < span class =code-keyword>>
< authorizati on >
< 允许 用户 = * / >
< / authorization >
< / system.web >
< / location >

但它始终会重定向到登录页面。请帮忙

解决方案

看看这个:



http://stackoverflow。 com / questions / 10367850 / is-it-it-allow-an -onymous-user-to-browse-few-files-from-a folder [ ^ ]

I use forms Authentication in my asp.net application. There are few files and folders which needs to have anonymous access though. For that i have added the section.
<system.web>
<authentication mode="Forms" >
<forms name=".ASPXFORMS" loginUrl="user/login.aspx" protection="All" path="/" timeout="30"/>
</authentication>

<authorization>
<deny users="?" />
</authorization>
<trust level="Full" />
<compilation debug="true" targetFramework="4.0" />
<customErrors mode="Off"/>
</system.web>

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

But still it always redirects to login page. Please help

解决方案

Check this out:

http://stackoverflow.com/questions/10367850/is-it-possible-to-allow-anonymous-user-to-browse-only-few-files-from-a-folder[^]


这篇关于表单身份验证:始终要求登录匿名页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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