设计+ Omniauth [警告:无法验证 CSRF 令牌的真实性]

发布于 2024-12-04 05:54:47 字数 727 浏览 4 评论 0原文

收到此警告

WARNING: Can't verify CSRF token authenticity

我在回调操作运行之前立即

Started GET "/users/auth/open_id?openid_url=https%3A%2F%2Fwww.google.com%2Faccounts%2Fo8%2Fid" for 98.xxx.xx.xx at 2011-09-12 16:26:02 -0400
Started GET "/users/auth/open_id/callback?openid_url=https%3A%2%2Fwww.google.com%2Faccounts ... etc ... etc
Processing by Users::OmniauthCallbacksController#open_id as HTML
Parameters: {"openid_url"=>"https://www.google.com/accounts/o8/id"}
WARNING: Can't verify CSRF token authenticity
Entering Users::OmniauthCallbacksController, omniauth_login

,即直接来自浏览器的请求没有警告。我使用的是 Rails 3.1、devise 1.4.5、omniauth 0.2.6。

关于如何解决这个问题的想法?

谢谢!

I am getting this warning

WARNING: Can't verify CSRF token authenticity

immediately before my callback action runs, i.e.

Started GET "/users/auth/open_id?openid_url=https%3A%2F%2Fwww.google.com%2Faccounts%2Fo8%2Fid" for 98.xxx.xx.xx at 2011-09-12 16:26:02 -0400
Started GET "/users/auth/open_id/callback?openid_url=https%3A%2%2Fwww.google.com%2Faccounts ... etc ... etc
Processing by Users::OmniauthCallbacksController#open_id as HTML
Parameters: {"openid_url"=>"https://www.google.com/accounts/o8/id"}
WARNING: Can't verify CSRF token authenticity
Entering Users::OmniauthCallbacksController, omniauth_login

There is no warning for requests coming directly from the browser. I am using rails 3.1, devise 1.4.5, omniauth 0.2.6.

Ideas on how to address this?

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

陈独秀 2024-12-11 05:54:47

关闭protect_from_forgery对我有用。

Turning off protect_from_forgery worked for me.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文