谷歌的OAuth 2授权 - 错误:redirect_uri_mismatch [英] Google OAuth 2 authorization - Error: redirect_uri_mismatch

查看:4762
本文介绍了谷歌的OAuth 2授权 - 错误:redirect_uri_mismatch的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在网站的的https://$c$c.google.com/apis/console 我已经注册了应用程序,设置生成的客户端ID:客户端揭秘,以我的应用程序,并试图与谷歌登录。
不幸的是,我得到了错误消息:

On the website https://code.google.com/apis/console I have registered my application, set up generated Client ID: and Client Secret to my app and tried to log in with Google. Unfortunately, I got the error message:

Error: redirect_uri_mismatch
The redirect URI in the request: http://127.0.0.1:3000/auth/google_oauth2/callback did not match a registered redirect URI

scope=https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email
response_type=code
redirect_uri=http://127.0.0.1:3000/auth/google_oauth2/callback
access_type=offline
approval_prompt=force
client_id=generated_id

这是什么意思这条消息,我怎么能解决这个问题?
我用的是创业板的 omniauth-谷歌-的oauth2

推荐答案

重定向的URI(这里的响应返回到)在API控制台注册​​,并且错误是表示你还没有做到这一点,或者没有正确完成它。

The redirect URI (where the response is returned to) has to be registered in the APIs console, and the error is indicating that you haven't done that, or haven't done it correctly.

进入控制台,为您的项目,并在API访问的样子。您应该看到您的客户端ID和放大器;秘密那里,重定向URI的名单。如果你想在URI未列出,单击编辑设置,并添加URI到列表中。

Go to the console for your project and look under API Access. You should see your client ID & secret there, along with a list of redirect URIs. If the URI you want isn't listed, click edit settings and add the URI to the list.

这篇关于谷歌的OAuth 2授权 - 错误:redirect_uri_mismatch的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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