尝试“使用Google登录”后,我在日志中看到此错误:
Processing by Users::OmniauthCallbacksController#failure as HTML
我可以通过URL(在日志中)查看从Google发送的所有数据,包括用户电子邮件和名称.那么可能出什么问题?我的回调甚至没有执行.我只被重定向到我网站的sign_in页面.
而且我很确定一切都配置正确,因为这在几个星期前工作正常.我不认为我改变了一切. Facebook登录仍然正常.
关于如何调试这个失败的任何想法?日志中没有其他内容,除了那些长时间的URL中,还有参数和值.只有INFO消息.上面发布的是唯一一个关于失败的东西.
UPDATE
def failure render :text => params.inspect end
哪个停止了重定向,并打印出来:
{}
这是url:
/users/auth/google/callback?_method=post&openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0&openid.mode=id_res&openid.op_endpoint=https%3A%2F%2Fwww.google.com%2Faccounts%2Fo8%2Fud&openid.response_nonce=2012-04-16T12%3A25%3A49Z_v1fNngSQJaHBQ&openid.return_to=http%3A%2F%2Fdev.myapp.me%3A3000%2Fusers%2Fauth%2Fgoogle%2Fcallback%3F_method%3Dpost&openid.assoc_handle=AMlYA9Urw_lYamPphTSdQ9a6DU0Ez0y5RaDDM78qPL7Xgm77nMpJiB85&openid.signed=op_endpoint%2Cclaimed_id%2Cidentity%2Creturn_to%2Cresponse_nonce%2Cassoc_handle%2Cns.ext1%2Cext1.mode%2Cext1.type.ext5%2Cext1.value.ext5%2Cext1.type.ext8%2Cext1.value.ext8%2Cext1.type.ext2%2Cext1.value.ext2&openid.sig=2FPjo7U1e%2Fde248XpUgjQLduNAM%3D&openid.identity=https%3A%2F%2Fwww.google.com%2Faccounts%2Fo8%2Fid%3Fid%3DAItOawk1F5U6x_-kJnydjoww5haU41tquh1Zl2c&openid.claimed_id=https%3A%2F%2Fwww.google.com%2Faccounts%2Fo8%2Fid%3Fid%3DAItOawk1F5U6x_-kJnydjoww5haU41tquh1Zl2c&openid.ns.ext1=http%3A%2F%2Fopenid.net%2Fsrv%2Fax%2F1.0&openid.ext1.mode=fetch_response&openid.ext1.type.ext5=http%3A%2F%2Faxschema.org%2FnamePerson%2Ffirst&openid.ext1.value.ext5=Some_User&openid.ext1.type.ext8=http%3A%2F%2Faxschema.org%2Fcontact%2Femail&openid.ext1.value.ext8=some_email%40gmail.com&openid.ext1.type.ext2=http%3A%2F%2Faxschema.org%2FnamePerson%2Flast&openid.ext1.value.ext2=Some_User
所以事情是,我需要的所有数据都在URL中,但是devise / omniauth并没有抓住它(显然这就是为什么它被称为’failure’方法而不是我的回调).我不知道它是否可以通过’params’数组访问,或者什么.
我也很感兴趣的是_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _也许这只是意味着omniauth对谷歌的请求是POST.
有什么想法吗?