Login via google and facebook using django-social-

2019-09-10 07:01发布

I am trying to integrate django-social-auth on my django app which is running on google app engine.
I am trying to implement google-oauth2 and facebook oauth login using django-social-auth.

SOCIAL_AUTH_GOOGLE_OAUTH2_KEY = '377490210257-****'
SOCIAL_AUTH_GOOGLE_OAUTH2_CLIENT_SECRET = '***********'
SOCIAL_AUTH_FACEBOOK_APP_ID = '******'
SOCIAL_AUTH_FACEBOOK_SECRET = 'xxxx'

AUTHENTICATION_BACKENDS = (
    'social_auth.backends.facebook.FacebookBackend',
    'social_auth.backends.google.GoogleOAuth2Backend',
    'django.contrib.auth.backends.ModelBackend',
)

When I try to login via google oauth, I get the following error:

TooManyRedirects at /complete/google-oauth2/
Exceeded 30 redirects.

When I try to login via facebook auth, I get the following error:

HTTPError at /complete/facebook/
400 Client Error: Bad Request

I am not sure whether are there any other configuration that needs to be done to make it run.
Since google app engine doesn't have django-social-auth as the library, I had to manually put all the libraries in the source folder.

1条回答
Melony?
2楼-- · 2019-09-10 07:27

You need to upgrade the version of urllib3, bug is documented here: https://github.com/shazow/urllib3/issues/356

查看更多
登录 后发表回答