如何使用 RESTful_authentication gem 对一个 Ruby on Rails 应用程序进行身份验证?
有人有什么想法吗? 情况是这样的:我有一个主要的 Rails 应用程序和一个辅助的应用程序。 辅助应用程序用于将 Web 服务请求转换为对主应用程序的 RESTful PUT。 辅助应用程序尝试添加的资源需要身份验证。 任何想法将不胜感激! 谢谢!
Anybody have any ideas? The situation is like this: I have a primary rails app and an auxiliary one. The auxiliary app is used to transform a web service request into a RESTful PUT to the main app. The resource the auxiliary app is attempting to add to requires authentication. Any ideas would be much appreciated! Thanks SO!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
ActiveResource 用于此目的:
在此处阅读如何从 ActiveResource 与 RESTful API 对话: http://api.rubyonrails.org/classes/ActiveResource/Base.html
ActiveResource is used for this purpose:
Read up on how to talk to RESTful API from ActiveResource here: http://api.rubyonrails.org/classes/ActiveResource/Base.html
我想我可能通过调查我的一些即时通讯联系人找到了自己的答案。 最合乎逻辑的方法是使用 Curb ruby gem。 从上述 API 中,只需启用 cookie jar,安全地进行身份验证,然后将 cookie 包含在需要身份验证的后续 HTTP 操作中;)
(当我实现此功能时,将发布一些代码..)
不过,仍然感谢评论和/或替代方案!
I think I may have found my own answer by polling some of my IM contacts. The most logical approach is to use the Curb ruby gem. From the aforementioned API, one simply enables the cookie jar, restfully authenticates and then includes the cookie in subsequent HTTP actions requiring authentication ;)
(Will post some code when I get this implemented..)
Would still appreciate comments and or alternatives though!