5

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.

neves
  • 33,186
  • 27
  • 159
  • 192
ajish
  • 183
  • 2
  • 8

1 Answers1

2

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

ajish
  • 183
  • 2
  • 8
  • 2
    Hi! Im trying to do this, but it seems to do logout first and then try to create a new account and a new socialaccount, not only the socialaccount. Can you share your configuration? Do you know if you did something different? – Throoze Aug 29 '13 at 06:15
  • Yes I concur with @Throoze - Please clarify the solution. – Routhinator Mar 08 '14 at 19:29
  • 5
    @Routh: In [django-allauth's repo](https://github.com/pennersr/django-allauth#social-account-tags) they talk about the `provider_login_url` tag and the `process` parameter. You can choose between `login` or `connect`. If you specify `connect`, it wont logout, but connect a new social account to the django user currently logged in. I spent more time than I would have liked to, before realizing this :(. – Throoze Mar 11 '14 at 04:15