Package: django-sauth
SAUTH - Social Media Authentication ComponentOverviewSauth Provide the social media authentication and authorization for django applications.DependenciesOAuth 2.0  support depends on python-oauth2Twiiter support depends on TwythonThe backends(social media provider) demands the application registration on their corresponding website.FacebookLinkedingoogleTwitterDependency Package Installationpip install twython or easy_install twythonpip install oauth2Installationfrom pypipip install django-sauth or easy_install django-sauthfrom github , clone the project django-sauthhttps://github.com/renjith-tring/django-sauthConfigurationintegrate sauth with django based applicationssettings.pyInstall sauth in python path(virtualenv) and  add the package in to installed appsINSTALLED_APPS = ( ‘.................’,'sauth',)Sauth providing two approachCollect all the data from the provider and display into json format  and you can easily process the data in to your needs , it will be good approach for Rest Api applications.No need syncdb or migrateCollect the data from the provider , store into the database and make sure user into Authenticated with the system.Need syncdb or migrate(depend on django version)Following second approach Add SauthAuthBackend in AUTHENTICATION_BACKENDS in settings.pyAUTHENTICATION_BACKENDS = ('sauth.backends.sauthcommonbackend.SauthAuthBackend','django.contrib.auth.backends.ModelBackend',)Add The SauthExceptionMiddleware in MIDDLEWARE_CLASSESMIDDLEWARE_CLASSES = ('sauth.middleware.middleware.SauthExceptionMiddleware',)Urls.pyurlpatterns = patterns('',…………………………………..,url(r'^', include('sauth.urls')),……………………………………,)Authentication with FacebookCreate the application in facebook  developer account[ https://developers.facebook.com/quickstarts/?platform=web]Add App id and Secrect key in settings.pyFACEBOOK_API_KEY = '*********************'FACEBOOK_SECRET_KEY = '*****************************************'FACEBOOK_APP_ID = FACEBOOK_API_KEYSAUTH_REDIRECT_URL = 'http://localhost:8000/complete/'[  Testing redirect url for google and linkedin is ‘http://127.0.0.1:8000/complete/’ ,for production for all the provider please add the redirect url like this[ eg: www.example.com/complete / ]SAUTH_FACEBOOK_SCOPE = [ ] # your choice, list format [ ‘scope1’,’scope2..’][ default : ['user_about_me','public_profile','email'] ]SAUTH_FACEBOOK_EXTRA_FIELDS = [ ]  #your choice , list format[‘field1’,’field2’,..][ default : ['id','first_name','last_name','email','gender'] ]optional [ second approach ]============SAUTH_AFTER_AUTH_URL = '/login/complete'SAUTH_CREATE_AUTH_USER = True==========================================SAUTH_LOGIN_ERROR_URL = 'sautherror' [ url name ][ default error will be shown by json format , if you need to get the errors in your views function you can add the url name here , you can easily get the error from sessionstatus : request.session['error_status']description : request.session['error_desc']reason : request.session['error_reason']]Authentication with LinkedinCreate the Application in linkedin developer account[https://www.linkedin.com/developer/apps/new?csrfToken=ajax%3A2134433661926155952 ]LINKEDIN_CLIENT_ID = '**************************'LINKEDIN_SECRET_KEY = '******************************'SAUTH_LINKEDIN_SCOPE = [ ] #your choice list format[ default:['rw_company_admin','r_basicprofile','w_share','r_emailaddress'] ]SAUTH_LINKEDIN_EXTRA_FIELDS = ( ‘l-filed1’ ,...,) # your choice in tuple format[ default : (id,skills,first-name,last-name,positions:(company:(name)),formatted-name,date-of-birth,industry,email-address,location,headline,picture-urls::(original)) ]Authentication with TwitterCreate the application with twitter developer account [ https://apps.twitter.com/app/new ]TWITTER_KEY = “ ”TWITTER_SECRET = “ ”Authentication with Google accountCreate the application with google developer account :[ https://console.developers.google.com/projectselector/apis/library ]GOOGLE_KEY = “******************.apps.googleusercontent.com”GOOGLE_SECRET_KEY = “ ************************* ”SAUTH_GOOGLE_SCOPE = [ ‘scope1’,’..2’, ] # your choice in list field[ default : ['plus.login', 'plus.me', 'userinfo.email', 'userinfo.profile'] ]How to Use .=============backends=========1) facebook2) twitter3) google4) linkedin-oauth2Authorization url is :=========================htpp://127.0.0.1:8000/auth/<backend>