title: Are sessions needed for python-social-auth
body: <p>I'm building a django app with an API backend(built with DRF) and angularjs client. My goal is to completely decouple the server and client using JWT in place of sessions. I'm attempting to integrate <a href="https://github.com/omab/python-social-auth">python-social-auth</a>(PSA) with <a href="https://github.com/GetBlimp/django-rest-framework-jwt">django-rest-framework-jwt</a>(DRFJWT), so my goal is to have an auth flow something to this:</p>
  
  <p>User logs with Email/facebook via angular client -> client posts form to PSA's url -> PSA login/create user ->[!] DRFJWT creates token that it then sends back to client -> client stores token in local storage then uses token each request</p>
  
  <p>[!]: This is currently where I'm struggling. My thinking is that I can modify the <a href="https://github.com/omab/python-social-auth/blob/master/social/actions.py#L28">do_complete</a> method in PSA like so</p>
  
  <pre><code>from rest_framework_jwt.utils import jwt_payload_handler, jwt_encode_handler
  
  
  def do_complete(backend, login, user=None, redirect_name='next',
              *args, **kwargs):
    # pop redirect value before the session is trashed on login()
    data = backend.strategy.request_data()
    redirect_value = backend.strategy.session_get(redirect_name, '') or \
                   data.get(redirect_name, '')
  
    is_authenticated = user_is_authenticated(user)
    user = is_authenticated and user or None
  
    partial = partial_pipeline_data(backend, user, *args, **kwargs)
    if partial:
        xargs, xkwargs = partial
        user = backend.continue_pipeline(*xargs, **xkwargs)
    else:
        user = backend.complete(user=user, *args, **kwargs)
  
    if user_is_active(user):
        # catch is_new/social_user in case login() resets the instance
        is_new = getattr(user, 'is_new', False)
        social_user = user.social_user
        login(backend, user, social_user)
  
    payload = jwt_payload_handler(user)
    return { 'token': jwt_encode_handler(payload) }
  </code></pre>
  
  <p>Is this the only way of doing what I'm trying to accomplish?</p>
  
  <p>I'm also wondering if its okay from a best-practices standpoint to use sessions to manage the pipeline and JWT for auth?</p>