Django-Socialauth - How to associate multiple authentication providers to a single user account

2k views Asked by At

Django-Social in its feature list claims that it supports associating multiple authentication providers to a single user account.

I can't seem to figure out how to use that feature.

When I try to login using a new authentication provider it automatically seems to be creating a new account for each provider.

Any ideas?

Sarvi

3

There are 3 answers

1
omab On BEST ANSWER

Take a look to django-social-auth, it's simpler and easier to setup than Django-Socialauth.

Multiple account association is supported but limited to logged in users to avoid the decision of which user instance must be removed.

0
gladysbixly On

it supports associating multiple authentication providers to a single user account

By looking at the code for models.py here, socialauth has a UserProfile for each provider, associating them to the User object which you use for basic authentication. So indeed, what it claims is true.

0
AgentK On

It can be done manually through admin once you have logged in with multiple accounts. Then the Socialauth models for the accounts can be adjusted to point at the User they are required too and multiple accounts can point to the same user.

But I have not had a good enough look to work out how to let users do this automatically for themselves. It does not work out of the box if you sign in to another account if while already signed into an existing account.