djangodjango-socialauth

Confirm user owns a social account without switching to a different logged user (django social auth)


I'm using Django social auth to log users in using Facebook, Twitter, etc as described, for example here.

Scenario: A user is logged onto my platform using my native login system. I want them to validate that they own a particular Twitter account without redirecting them to a view where request.user is a new UserSocialAuth associated with their Twitter account. I want to show the user the Twitter login page but, after they provided their credentials, keep them logged in as they were rather than log them in as a different user.


Solution

  • can add more accessible details for your social users indicated here:

    https://python-social-auth.readthedocs.io/en/latest/configuration/django.html#database