如何使Google OAuth2身份验证有效?

时间:2013-03-31 03:40:45

标签: django oauth-2.0 django-socialauth

我正在使用优秀的Django Social Auth应用来处理来自各种服务的登录。这适用于Twitter,Facebook和LinkedIn,但我无法弄清楚为什么它不适用于谷歌。我已经多次尝试这个消息,尝试了我能想到的所有选项:

Error: redirect_uri_mismatch
Request Details
scope=https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email
response_type=code
access_type=offline
redirect_uri=http://dev.mysite.com/complete/google-oauth2/
next=/close_login_popup/
state=OHZtGyZPyrM0XUjzEsf8dv22VAZGXSY6
display=page
client_id=820357455247-4levikqugduodacfc8j3b5dhsvmbbnnb.apps.googleusercontent.com

要创建API密钥,我转到https://code.google.com/apis/,然后使用以下步骤填写表单:

enter image description here

然后,我选择了“已安装的应用程序”,我并不完全了解,但大多数文档都提供了此选项。我尝试了其他两种选择但没有成功:

enter image description here

如果我尝试创建指定Web Application的{​​{1}},我会收到以下错误:

http://.dev.mysite.com

我的目标是建立一个人可以点击的链接,授予Google权限,然后登录我的网站。我正在实际网站Error: redirect_uri_mismatch The redirect URI in the request: http://dev.mysite.com/complete/google-oauth2/ did not match a registered redirect URI Learn more Request Details scope=https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email response_type=code access_type=online redirect_uri=http://dev.mysite.com/complete/google-oauth2/ next=/close_login_popup/ state=xcpu93i7XJJmYlwXnRbkfgEwsbbR1O7c display=page client_id=606300275392.apps.googleusercontent.com 上对此进行测试,在尝试其他密钥生成选项时,我指定了wwww.dev.mysite.com。我很感激任何关于接下来要尝试什么的建议,因为我已经没有想法了。

0 个答案:

没有答案
相关问题