0

我正在尝试在 Rails 中使用“omniauth-google-oauth2”gem。我已将我的应用程序作为 Web 应用程序注册到云控制台,并试图让它工作,但是当我尝试访问此 URL 时: https ://accounts.google.com/o/oauth2/auth?response_type=code&client_id =XXX.project.googleusercontent.com&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2Fusers%2Fauth%2Fgoogle_oauth2%2Fcallback&state=5d7e3e04fffd3bfd4c7716a53c96583047d200b285db60a3&scope=https%3A%2F%3%2Fuserinfoaemail %2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile&access_type=offline

它向我抛出了 Google 的“错误:invalid_client”页面。我从他们在 api 和 auth 部分提供的 json 中获取的客户端 ID 和秘密..

你认为可能是什么问题?

4

3 回答 3

1

嗯..您有 XXX.project.googleusercontent.com,但 client_ids 通常有 xxx.apps.googleusercontent.com。尝试从 API 控制台复制和粘贴以排除拼写错误的可能性。

于 2013-09-27T07:00:37.050 回答
1

我也有类似的问题。出于某种原因,如果您将应用程序类型从 Web 应用程序更改为其他应用程序,它就可以解决问题。

于 2015-12-10T21:30:01.040 回答
0

这里非常相似的问题:invalid_client in google oauth2

A:错误是否还报告它缺少应用程序名称?在项目设置对话框中创建项目名称(例如“项目 X”)之前,我遇到了这个问题。

于 2013-09-20T20:50:04.113 回答