使用django-social-auth通过google和Facebook登录 [英] Login via google and facebook using django-social-auth

查看:687
本文介绍了使用django-social-auth通过google和Facebook登录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将 django-social-auth 整合到我的django应用程序在谷歌应用程序引擎上运行。


我试图用django-social-auth来实现google-oauth2和facebook oauth登录。

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',
)

当我尝试通过google oauth登录时,我收到以下错误:

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

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

当我尝试通过facebook auth登录,我收到以下错误:

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

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

我不知道是否有需要做任何其他配置来使其运行。


由于Google应用引擎没有django-social-auth作为库,所以我不得不手动将所有的库放在源文件夹中。

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.

推荐答案

您需要升级urllib3的版本,错误在此记录: https://github.com/shazow/urllib3/issues/356

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

这篇关于使用django-social-auth通过google和Facebook登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆