Connect with Facebook in Django Rest Framework + Django Social Auth

TheNone picture TheNone · Apr 2, 2014 · Viewed 17.6k times · Source

I'm using Django Social Auth for connect with Facebook issue and it works perfect. I have developed an API for my Django app with Django Rest Framework. But I'm confused about using Django Social Auth with Django Rest Framework for iOS devices.

I have searched 1, 2, 3 and 4 but they are generally with Angular.js. I'm not familiar with iOS development.

  • What is different between facebook connect with spa and a mobile device? * How could I use these packages together?
  • May I migrate from django-social-auth to python-social-auth?

Answer

Hugo Sequeira picture Hugo Sequeira · Apr 16, 2015

You can now authenticate your users against your django-rest-framework with bearer tokens/third party access tokens from any python-social-auth backend (Facebook, Google, Github, etc.) using this library https://github.com/PhilipGarnero/django-rest-framework-social-oauth2

This module provides a python-social-auth and oauth2 support for django-rest-framework. Thus this saves you a lot of time to setup what is required to have your DRF with social authorization and to be OAuth2 secure.