如何使用django-allauth将多个社会认证服务器连接到同一个django用户? [英] how do i connect multiple social auth providers to the same django user using django-allauth?

查看:182
本文介绍了如何使用django-allauth将多个社会认证服务器连接到同一个django用户?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以连接到Facebook和Twitter,但是如何将普通django用户连接到他的Facebook和Twitter网络,以便下次他可以选择通过3中的任何一个登录,我可以利用信息来自两个网络。



可以发出信号: -



allauth.socialaccount.signals.pre_social_login



用于检查用户是否已经登录,如果是,将社交帐户连接到django帐户,但我无法弄清楚如何在登录视图中实现。

解决方案

连接到不同的社会服务提供商变得非常简单。如果在用户主页(如使用django auth登录后正常的django用户将访问的页面)访问用户,用户将其登录到社交提供者,则会将自己的django配置文件自动链接到社交应用配置文件。 / p>

现在我正在研究如何使用图形API和allauth来获取好友列表,发贴到墙壁等


can connect to facebook and twitter, but how do i connect a normal django user to both his facebook and twitter networks, so that the next time he has the option of logging in through any 1 of the 3 and i can utilise information from both the networks.

can the signal :-

allauth.socialaccount.signals.pre_social_login

be used to check if a user is already logged in if yes connect the social account to the django account, but i cant figure out how to go about implementing this in the login view.

解决方案

connecting to different social providers turned out to be pretty easy. The same url which was used to login the users to a social provider if accessed inside a users home page( ie the page a normal django user will see after logging in using django auth) links your django profile to the social app profile automatically.

now I am looking into how to use the graph api along with allauth to fetch friend lists, post to wall etc

这篇关于如何使用django-allauth将多个社会认证服务器连接到同一个django用户?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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