Login via google and facebook using django-social-auth

≡放荡痞女 提交于 2020-01-17 13:41:10

问题


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:


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



来源:https://stackoverflow.com/questions/21515035/login-via-google-and-facebook-using-django-social-auth

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!