djangofacebookdjango-socialauthdjango-facebook

How can I override/extend the "pipeline" flow used in django-social-auth?


This is discussed in this thread but it looks like it hasn't been documented yet.

I'm ultimately trying to create the following Facebook Connect sign-up flow:

  1. User connects to Facebook (such that django-social-auth gets an access token but doesn't yet create a User in Django)

  2. User is taken to a View that I'll write which will have the access token so that I can provide a registration form and include data from Facebook (e.g. "here's your Facebook profile picture, you can optionally upload a new one to use on our site")

  3. User clicks a link to create account and only then is the Django user created.

Right now I'm trying to step-through and reverse-engineer the django-social-auth source to figure out a way to do this, but if someone could show an example or even a high level explanation of a plausible way to do this, that would be awesome.


Solution

  • Backend init.py

    line 71 at the time of this reply.

    PIPELINE = setting('SOCIAL_AUTH_PIPELINE', (
                'social_auth.backends.pipeline.social.social_auth_user',
                'social_auth.backends.pipeline.associate.associate_by_email',
                'social_auth.backends.pipeline.user.get_username',
                'social_auth.backends.pipeline.user.create_user',
                'social_auth.backends.pipeline.social.associate_user',
                'social_auth.backends.pipeline.social.load_extra_data',
                'social_auth.backends.pipeline.user.update_user_details',
           ))
    

    Adding SOCIAL_AUTH_PIPELINE to your settings file and editing those values should allow you to customize you pipeline.

    Also, by what you wrote, you might want to set SOCIAL_AUTH_CREATE_USERS to false

    edit:Fix link