OAuth :: Google+登录API未经授权400错误 [英] OAuth::Unauthorized 400 error with Google+ login API

查看:783
本文介绍了OAuth :: Google+登录API未经授权400错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Devise和omniauth在我正在开发的应用程序中设置Google+登录,并进入OAuth :: Unauthorized 400错误。我使用的是omniauth-google宝石。我的设计配置为Google设置全方位:

I'm trying to set up Google+ login with Devise and omniauth in an app I'm working on and running into an OAuth::Unauthorized 400 error. I'm using the omniauth-google gem. My Devise config sets up omniauth for Google:

config.omniauth :google, ENV['GOOGLE_KEY'], ENV['GOOGLE_SECRET'], scope: 'plus.login'

我在dev.app本地运行网站.com:3000,在Google Developers Console的我的应用设置中,我将JavaScript的起始地址设置为http://dev.app.com:3000,重定向URI为http://dev.app.com :3000 /用户/认证/谷歌/回调。我确认我的密钥和秘密是正确的。这里有什么问题?

I'm running the site locally on dev.app.com:3000, and in my app settings in the Google Developers Console I've set the JavaScript origin to be http://dev.app.com:3000 and the redirect URI to be http://dev.app.com:3000/users/auth/google/callback. I've confirmed that my key and secret are correct. What's the problem here?

推荐答案

我没有看到任何问题,您可以用本教程获得更好的图片
[ https:// www.digitalocean.com/community/tutorials/how-to-configure-devise-and-omniauth-for-your-rails-application

I am not seeing any problem there, you can get better picture with this tutorial [https://www.digitalocean.com/community/tutorials/how-to-configure-devise-and-omniauth-for-your-rails-application

或u可以尝试

omniauth-google-oauth2

omniauth-google-oauth2

https://github.com/zquestz/omniauth-google-oauth2

这篇关于OAuth :: Google+登录API未经授权400错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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