{ "info": { "author": "Renjith S Raj", "author_email": "renjithsraj@live.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Topic :: Internet" ], "description": "SAUTH - Social Media Authentication Component \n\nOverview\n\nSauth Provide the social media authentication and authorization for django applications.\n\nDependencies\n\nOAuth 2.0 support depends on python-oauth2\nTwiiter support depends on Twython\nThe backends(social media provider) demands the application registration on their corresponding website.\nFacebook \nLinkedin\ngoogle\nTwitter\n\nDependency Package Installation\n\npip install twython or easy_install twython\npip install oauth2\n\nInstallation\n\nfrom pypi\n\npip install django-sauth or easy_install django-sauth\n\nfrom github , clone the project django-sauth\n\nhttps://github.com/renjith-tring/django-sauth\n\n\nConfiguration\n\nintegrate sauth with django based applications\n\nsettings.py\n\nInstall sauth in python path(virtualenv) and add the package in to installed apps\n\n INSTALLED_APPS = ( \u2018.................\u2019,\n 'sauth',\n )\nSauth providing two approach\nCollect 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.\n No need syncdb or migrate\n Collect the data from the provider , store into the database and make sure user into Authenticated with the system.\n Need syncdb or migrate(depend on django version) \n\nFollowing second approach Add SauthAuthBackend in AUTHENTICATION_BACKENDS in settings.py \n\n AUTHENTICATION_BACKENDS = (\n 'sauth.backends.sauthcommonbackend.SauthAuthBackend',\n 'django.contrib.auth.backends.ModelBackend',)\nAdd The SauthExceptionMiddleware in MIDDLEWARE_CLASSES\n\n MIDDLEWARE_CLASSES = (\n 'sauth.middleware.middleware.SauthExceptionMiddleware',\n )\nUrls.py\n\nurlpatterns = patterns('',\n \u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026..,\n url(r'^', include('sauth.urls')),\n \u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026,\n)\n\n\nAuthentication with Facebook\n\nCreate the application in facebook developer account[ https://developers.facebook.com/quickstarts/?platform=web]\n\nAdd App id and Secrect key in settings.py \n\nFACEBOOK_API_KEY = '*********************'\nFACEBOOK_SECRET_KEY = '*****************************************'\nFACEBOOK_APP_ID = FACEBOOK_API_KEY\nSAUTH_REDIRECT_URL = 'http://localhost:8000/complete/'\n[ Testing redirect url for google and linkedin is \u2018http://127.0.0.1:8000/complete/\u2019 , \nfor production for all the provider please add the redirect url like this[ eg: www.example.com/complete / ]\nSAUTH_FACEBOOK_SCOPE = [ ] # your choice, list format [ \u2018scope1\u2019,\u2019scope2..\u2019]\n[ default : ['user_about_me','public_profile','email'] ]\n\nSAUTH_FACEBOOK_EXTRA_FIELDS = [ ] #your choice , list format\n[\u2018field1\u2019,\u2019field2\u2019,..]\n[ default : ['id','first_name','last_name','email','gender'] ]\n\n\n\noptional [ second approach ]\n============\nSAUTH_AFTER_AUTH_URL = '/login/complete'\nSAUTH_CREATE_AUTH_USER = True\n==========================================\n\nSAUTH_LOGIN_ERROR_URL = 'sautherror' [ url name ] \n[ 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 session \nstatus : request.session['error_status']\ndescription : request.session['error_desc']\nreason : request.session['error_reason']\n ]\n\nAuthentication with Linkedin\nCreate the Application in linkedin developer account[ \nhttps://www.linkedin.com/developer/apps/new?csrfToken=ajax%3A2134433661926155952 ]\n\nLINKEDIN_CLIENT_ID = '**************************'\nLINKEDIN_SECRET_KEY = '******************************'\nSAUTH_LINKEDIN_SCOPE = [ ] #your choice list format\n[ default:['rw_company_admin','r_basicprofile','w_share','r_emailaddress'] ] \nSAUTH_LINKEDIN_EXTRA_FIELDS = ( \u2018l-filed1\u2019 ,...,) # your choice in tuple format \n[ default : (id,skills,first-name,last-name,positions:(company:(name)),formatted-name,date-of-birth,industry,email-address,location,headline,picture-urls::(original)) ]\n\n\n\n\nAuthentication with Twitter\n\nCreate the application with twitter developer account [ https://apps.twitter.com/app/new ]\n\nTWITTER_KEY = \u201c \u201d\nTWITTER_SECRET = \u201c \u201d\n\nAuthentication with Google account\n\nCreate the application with google developer account : \n[ https://console.developers.google.com/projectselector/apis/library ]\n\nGOOGLE_KEY = \u201c******************.apps.googleusercontent.com\u201d\nGOOGLE_SECRET_KEY = \u201c ************************* \u201d\nSAUTH_GOOGLE_SCOPE = [ \u2018scope1\u2019,\u2019..2\u2019, ] # your choice in list field\n\n[ default : ['plus.login', 'plus.me', 'userinfo.email', 'userinfo.profile'] ]\n\n\nHow to Use .\n=============\n\nbackends \n=========\n\n1) facebook\n2) twitter\n3) google\n4) linkedin-oauth2\n\nAuthorization url is :\n=========================\n\nhtpp://127.0.0.1:8000/auth/", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/renjithsraj/django-sauth", "keywords": "django,oauth,social auth", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "django-sauth", "package_url": "https://pypi.org/project/django-sauth/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-sauth/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/renjithsraj/django-sauth" }, "release_url": "https://pypi.org/project/django-sauth/1/", "requires_dist": null, "requires_python": null, "summary": "django sauth is an easy to setup social authentication/registration mechanism with support for several auth providers.", "version": "1" }, "last_serial": 2725064, "releases": { "1": [] }, "urls": [] }