Search code examples
djangodjango-rest-frameworkpython-social-auth

How do I associate multiple python-social-auth social accounts with an existing user via REST api?


I'm using python-social-auth to allow my users to register via Apple and Google. I'm trying to figure out how via REST I can associate social accounts to an existing user with a different email than the social account (project req is that users are manually created in the backend and then can associate a social login for ease-of-access). This is a React Native app so the usual automatic way of active sessions won't work. I'm using https://github.com/st4lk/django-rest-social-auth to create easy endpoints.

Thanks in advance y'all.


Solution

  • I got it working. I ended up doing this by creating an associated_email field on profile model for each social auth service, and writing a customized version of associate by email step in the pipeline that verifies against that field.

    Thanks y'all.