Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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. Facebook worked almost out of the box. However, with Google I get the "Social Network Login Failure" error.

Here is what I have done:

1.Google APIs console: Client ID for web applications configuration

 Client ID: xxxxxxx.apps.googleusercontent.com
 Email address: [email protected]
 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

3.Created the google app in Social Apps with the Client ID and secret from the google API console.

From the docs and few other SO questions, seems like that is all that is needed.

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'. 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.

like image 751
zaphod Avatar asked Nov 11 '22 22:11

zaphod


1 Answers

I've tried to access http://learnbuzz.com/accounts/google/login/callback and it requests http authorization. It is returning a 401 status code.

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.

like image 144
neves Avatar answered Dec 12 '22 22:12

neves