简体   繁体   English

django-allauth google integration会出现“社交网络登录失败”错误

[英]django-allauth google integration gives “Social Network Login Failure” error

I am working on an external site to integrate django-allauth for facebook and google login. 我正在外部网站上集成django-allauth用于facebook和谷歌登录。 Facebook worked almost out of the box. Facebook的工作几乎开箱即用。 However, with Google I get the "Social Network Login Failure" error. 但是,有了Google,我收到了“社交网络登录失败”错误。

Here is what I have done: 这是我做的:

1.Google APIs console: Client ID for web applications configuration 1.Google API控制台:Web应用程序配置的客户端ID

 Client ID: xxxxxxx.apps.googleusercontent.com
 Email address: yyyyyyyy@developer.gserviceaccount.com
 Client secret: xxx-yyy-zzz-111-222
 Redirect URIs: http://learnbuzz.com/accounts/google/login/callback/
 JavaScript origins: http://www.learnbuzz.com

2.Created learnbuzz.com site in Sites 2.在Sites中处理learnbuzz.com网站

3.Created the google app in Social Apps with the Client ID and secret from the google API console. 3.使用Google API控制台中的客户端ID和密码修复社交应用中的Google应用。

From the docs and few other SO questions, seems like that is all that is needed. 从文档和其他一些SO问题看来,这就是所需要的。

But, when I log in using google, I get to the accounts.google.com page where it asks the user to accept 'App sharing basic user information and email'. 但是,当我使用谷歌登录时,我会访问accounts.google.com页面,要求用户接受“应用程序共享基本用户信息和电子邮件”。 After I accept, it gives me a "Social Network Login Failure" for this url: 在我接受后,它为我提供了此网址的“社交网络登录失败”:

http://learnbuzz.com/accounts/google/login/callback/?state=l1WdxOgr26bB&code=4/lGhX6Dum_FNnM3FE39TcULZb1UMX.0jX6biQfm3MfEnp6UAPFm0F0CIGMgQI

What config am I missing? 我错过了什么配置?

Edit: I don't know if it matters but it takes the browsers quite some time before it throws out this error. 编辑:我不知道它是否重要但它需要浏览器相当一段时间才能抛出此错误。

I've tried to access http://learnbuzz.com/accounts/google/login/callback and it requests http authorization. 我尝试访问http://learnbuzz.com/accounts/google/login/callback并请求http授权。 It is returning a 401 status code. 它返回401状态代码。

Probably your browser is already logged in and you can't see this request for authentication. 可能您的浏览器已经登录,您无法看到此身份验证请求。

This page should be accessible from an anonymous browser windows. 可以从匿名浏览器窗口访问此页面。 After you remove the need for authorization, it will work. 删除授权需求后,它将起作用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM