OmniAuth 无效响应错误 [英] OmniAuth Invalid Response Error

查看:25
本文介绍了OmniAuth 无效响应错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将 OmniAuth 与 Devise 结合使用,以允许用户使用 Facebook 登录或使用用户名和密码创建普通帐户.当我最初设置这一切时,我使用了 Railscasts 中的优秀指导.一切都很好地运行了 2 个多月,但就在前几天,facebook 登录停止工作.OmniAuth 将您发送到 facebook 进行身份验证,然后返回:http://localhost:3000/auth/failure?message=invalid_response

I'm using OmniAuth with Devise to allow users to login with facebook or to create a normal account with a username and password. When I originally set it all up I used the excellent directions from Railscasts. Everything was working very nicely for 2+ months but just the other day the facebook login stopped working. OmniAuth sends you away to the authentication with facebook and then returns with: http://localhost:3000/auth/failure?message=invalid_response

Google 对导致此错误的原因或如何修复它没有任何建议,OmniAuth 文档也没有.我也尝试过挖掘他们的代码,但我发现的唯一提到的这个错误是在 /oa-oauth/lib/omniauth/strategies/oauth.rb 中:

Google has no suggestions on what causes this error or how to fix it and the OmniAuth docs don't either. I've tried digging through their code as well but the only mention of this error I've found is this, in /oa-oauth/lib/omniauth/strategies/oauth.rb:

rescue ::MultiJson::DecodeError => e
  fail!(:invalid_response, e)
end

有没有人见过这个错误!?知道它是什么或如何修复它?!这使我无法启动此应用程序,因此非常感谢任何帮助!

Has anyone ever seen this error!? Know what it is or how to fix it?! This is keeping me from launching this application so any help would be very very appreciated!

谢谢,JG

推荐答案

好的,

我不确定为什么这会奏效,但确实如此,因此我会在此处发帖,以帮助最终遇到此问题的其他人.

I'm not sure why this has worked but it has so I'll post here in the effort to help someone else that ends up with this issue.

我升级了我的应用程序以使用 ruby​​ 1.9.2(未来的方式!)然后砰的一声,它再次运行了.不知道为什么,但嘿,有时候就是这样.

I upgraded my app to use ruby 1.9.2 (way of the future!) and bang, it just worked again. No idea why but hey sometimes that's just the way it goes.

不过升级真的很容易.我被这个 dhh 推文 &发现 thisthis 是确保您的 1.8.7 代码在 1.9.2 中工作的非常有用的资源.对 heroku 的支持也使升级应用程序变得如此容易.

Upgrading was really easy though. I was sparked into upgrade action by this dhh tweet & found this and this to be really helpful resources in making sure your 1.8.7 code will work in 1.9.2. Props to heroku as well for making it so easy to upgrade an app.

这篇关于OmniAuth 无效响应错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆