SharePoint 2010 ashx 处理程序匿名访问
我在网上看到了大量有关如何通过继承 UnsecuredLayoutsPageBase 等来允许匿名访问特定 SharePoint 应用程序页面的信息。
如何为位于布局目录中的 ashx 处理程序实现相同的功能?默认情况下,SP 将需要身份验证才能访问处理程序。我可以通过允许匿名访问网站本身来解决这个问题,但我无法摆脱这个......我只需要匿名访问处理程序。我尝试将 web.config 文件粘贴在与处理程序相同的目录中并允许匿名访问,但这仍然不起作用。
I've seen plenty of information on the web about how to allow anonymous access to a specific SharePoint Application page by inheriting from UnsecuredLayoutsPageBase, etc.
How can I achieve the same thing for an ashx handler that lives in the layouts directory? By default, SP will require authentication to get to the handler. I can get around this by allowing anonymous access to the site itself, but I can't get away with that...I need anonymous access to only the handler. I have tried to stick a web.config file in the same directory as the handler and allow anonymous access there, but that still doesn't work.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我也有同样的情况。您表示您“无法摆脱 [...] 允许匿名访问网站本身”,所以我不确定我的解决方案是否适合您,但它是:
或者,在我的开发网站上,我启用了 SharePoint 匿名访问,打开了 IIS 管理器的匿名访问,然后创建了 2 个 web.config 规则。
但是,我认为该版本过于复杂。我更喜欢第一个选择。
I had the same situation. You stated that you "can't get away with [...] allowing anonymous access to the site itself", so I'm not sure if my solution will work for you, but here it is:
Alternatively, on my dev site I enabled SharePoint Anonymous Access, turned on anonymous access from IIS manager, and then created 2 web.config rules
However, I think that version is overcomplicated. I prefer the first option.