在设备上设置 ssl
我想要求对设备上的用户资源进行 ssl 身份验证。我期待它像在 Rails 中一样简单,例如:
devise_for :users, :constraints => { :protocol => "https" }
另外,我在 devise 的 github 上找不到任何文档,尽管我在 google groups 中发现了一些指向它的死链接。
有人提示如何让它轻松工作吗?考虑到该插件的受欢迎程度,我以为我会很简单
I'd like to require ssl authentication for the user resource on devise. I was expecting that to be as simple as it is in rails, like:
devise_for :users, :constraints => { :protocol => "https" }
Also, I couldn't find any documentation on devise's github, though I've found some dead links pointing to it at the google groups.
Does anybody has a hint on how to get it working easily? I thought I'd be simple, given the popularity of the plugin
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
:constraints 不会作为选项起作用,但这可能会:
:constraints won't work as option, but this probably will:
将 SSL 要求集成到您的应用中并使用设计。答案不起作用,但这对我有用,特别是因为我已经使用了 SSL 要求。
Integrate SSL Requirement into your app and using Devise. The answer didn't work but this did for me, especially since I was using SSL Requirement already.
我建议使用 Rack::SSL,也许可以使用Rack::SslEnforcer 了解更多配置选项。
I suggest using Rack::SSL, maybe with Rack::SslEnforcer for more configuration options.