AlexA
AlexA

Reputation: 4118

Django package for linking user to FB account

What is the most appropriate Django package for linking regular Django user to FB account? Scenario:

  1. User of regular Django site registers an account
  2. He logs in using plain login/password
  3. He connects his regular account to FB account and able to re-link later it to different FB account if needed.

I can't seem to find a package that matches all of the requirements, seems that most packages(django-facebook, django-social-auth) assume that initial login/registration to site is done through social media, while all I want is - regular django login and some optional/delayed access to social media.

Upvotes: 0

Views: 592

Answers (1)

dshap
dshap

Reputation: 1402

django-social-auth should let you do what you want, since it allows multiple social accounts (e.g. Facebook, LinkedIn, etc...) to be associated with a single Django user (the core auth.User, not a custom user class like some other apps use).

I would look at django-social-auth's pipeline feature and use the social_auth.backends.pipeline.social.associate_user function to associate a Facebook account to an existing User.

Upvotes: 5

Related Questions