基于URL的授权和ajaxpro问题
我有一个使用 Ajaxpro 和表单身份验证的 ASP.NET 应用程序。首先,我在试图避免通过授权传递 ajaxpro 处理程序时遇到了麻烦,当我将它们包含在 web.config 的不同位置时,这个问题得到了解决:
<location path="ajaxpro/prototype.ashx">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
<location path="ajaxpro/core.ashx">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
<location path="ajaxpro/converter.ashx">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
但是,当我尝试访问我们的 AjaxMethods 时,我仍然收到 401 错误。我尝试将我们的类型置于以下配置下:
<location path="ajaxpro/MyType,MyAssembly.ashx">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
但这无法正常工作,并且在某些特定情况下我仍然收到 401 响应:我意识到,当我的请求有一些查询字符串值时,此设置不会在职的。
我希望我可以做类似 path="ajaxpro/*" 的事情,但似乎这是不可能的。还有人有其他想法吗?
I have an ASP.NET app using Ajaxpro and forms authentication. First I was having trouble trying to avoid passing the ajaxpro handlers through authorization, which was resolved when I included them on separate locations on the web.config:
<location path="ajaxpro/prototype.ashx">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
<location path="ajaxpro/core.ashx">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
<location path="ajaxpro/converter.ashx">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
However, I'm still getting 401 errors when I try to access our AjaxMethods. I event tried to put our types under the following configuration:
<location path="ajaxpro/MyType,MyAssembly.ashx">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
but that didn't work properly, and I'm still getting 401 responses in some particular cases: I realized that when my requests have some query string values, this setting isn't working.
I wish I could do something like path="ajaxpro/*", but it seems like that is not possible. Does anyone have other ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该能够仅使用文件夹名称指定位置,如下所示:
You should be able to specify the location with folder name only like this: