使用 OpenRasta 进行身份验证
我正在尝试使用 OpenRasta 来提供简单的 RESTful 服务。该服务需要通过 http 基本身份验证或(最好是)摘要来保护。
环顾网络,有数十个网页写着 OpenRasta 有多棒,甚至支持摘要式身份验证,但我还没有找到一个示例来说明如何为我的设备启用其中任何一个。服务。
在我的方法或处理程序上放置 RequiresAuthentication 似乎没有做任何事情。
以前有人真正这样做过吗?或者它只是一个梦境?
更新:我放弃了工作,转而使用 OpenRasta 的 Scott Littlewoods 分支。他改变了身份验证的工作方式,并使用他的实现,我成功地完成了基本和摘要。
I'm trying to use OpenRasta for a simple RESTful service. This service needs to be secured with either http Basic authentication or (preferably) Digest.
Looking around the net, there are tens of webpages writing how wonderful OpenRasta is and that it even supports Digest authentication but I haven't been able to find a single example of how to enable either of those for my service.
Putting a RequiresAuthentication on my method or handler doesn't seem to be doing anything.
Has anyone actually done this ever before? Or is it just a dreamware?
UPDATE: I gave up on getting to work and went with Scott Littlewoods fork of OpenRasta. He has changed the way authentication works and using his implementation, I managed to do both Basic and Digest.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我整理了一篇小博客文章和示例应用程序来展示如何使用 OpenRasta 的当前 RTM 启用摘要式身份验证。
http://scottondotnet.blogspot.com/2010/10/openrasta-digest -authentication.html
源代码可以在这里找到: http://github.com/scottlittlewood/OpenRastaDigestDemo
I've put together a small blog post and sample application to show how to enable Digest Authentication using the current RTM of OpenRasta.
http://scottondotnet.blogspot.com/2010/10/openrasta-digest-authentication.html
The source code can be found here: http://github.com/scottlittlewood/OpenRastaDigestDemo
查看 OpenRasta.Security 中的类。您需要在容器中实现并注册一个 IAuthenticationProvider 以便摘要启动。
如果执行此操作后它仍然不起作用,请检查调试日志,并在邮件列表上发送它的副本,那里的人们将能够帮助你。
Look at the classes in OpenRasta.Security. THere's an IAuthenticationProvider you need to implement and register in the container for digest to kick in.
Check the debug log if after doing this it still doesn't work, and send a copy of it on the mailing lists, people there will be able to help you.
我认为问题在于使用 Cassini(内置于 VS.NET)进行调试。 Cassini 不像 IIS 那样支持身份验证。当我切换到使用 IIS 时,它开始提示我进行身份验证。
I think the issue is with the use of Cassini (built in to VS.NET) to debug. Cassini doesn't support authentication like IIS does. When I switched to using IIS it began to prompt me for authentication.