Package: eckerd-django-google-sso
Eckerd Django Google SSO============A reusable django application for google ssoInstallation------------To get the latest stable release from PyPi.. code-block:: bashpip install eckerd-django-google-ssoTo get the latest commit from GitHub.. code-block:: bashpip install -e git+git://github.com/christopherdavenport/eckerd-django-google-sso.git#egg=eckerd-django-google-ssoTODO: Describe further installation steps (edit / remove the examples below):Add ``eckerd-django-google-sso`` to your ``INSTALLED_APPS``.. code-block:: pythonINSTALLED_APPS = (...,'eckerd-django-google-sso','social.apps.django_app.default','django12factor',)Add the ``eckerd-django-google-sso`` URLs to your ``urls.py``.. code-block:: pythonurlpatterns = [url(r'^/', include('eckerd-django-google-sso.urls')),]Before your tags/filters are available in your templates, load them by using.. code-block:: html{% load backend_utils %}Don't forget to migrate your database.. code-block:: bash./manage.py migrateUsage-----Simple Wrap Your Content In a @LOGIN_REQUIREDFinally Drop These Settings In Place In The Final Application.. code-block:: pythonAUTHENTICATION_BACKENDS = ('social.backends.google.GoogleOAuth2','django.contrib.auth.backends.ModelBackend',)AUTH_USER_MODEL = 'eckerd-django-google-sso.CustomUser'SESSION_EXPIRE_AT_BROWSER_CLOSE = TrueLOGIN_URL = '/login/'LOGIN_REDIRECT_URL = '/'URL_PATH = ''SOCIAL_AUTH_STRATEGY = 'social.strategies.django_strategy.DjangoStrategy'SOCIAL_AUTH_STORAGE = 'social.apps.django_app.default.models.DjangoStorage'# Google OAuth2 (google-oauth2)SOCIAL_AUTH_GOOGLE_OAUTH2_IGNORE_DEFAULT_SCOPE = TrueSOCIAL_AUTH_GOOGLE_OAUTH2_USE_UNIQUE_USER_ID = TrueSOCIAL_AUTH_GOOGLE_OAUTH2_WHITELISTED_DOMAINS = ['eckerd.edu']SOCIAL_AUTH_GOOGLE_OAUTH2_SCOPE = ['https://www.googleapis.com/auth/userinfo.email','https://www.googleapis.com/auth/userinfo.profile']SOCIAL_AUTH_PIPELINE = ('social.pipeline.social_auth.social_details','social.pipeline.social_auth.social_uid','social.pipeline.social_auth.auth_allowed','social.pipeline.social_auth.associate_by_email','social.pipeline.social_auth.social_user','social.pipeline.user.get_username','social.pipeline.user.create_user','social.pipeline.social_auth.associate_user','social.pipeline.social_auth.load_extra_data','social.pipeline.user.user_details')SOCIAL_AUTH_ADMIN_USER_SEARCH_FIELDS = ['first_name', 'last_name', 'email','username']custom_settings = ('SOCIAL_AUTH_GOOGLE_OAUTH2_KEY','SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET',)import django12factord12f = django12factor.factorise(custom_settings=custom_settings)DATABASES = d12f['DATABASES']SECRET_KEY = d12f['SECRET_KEY']SOCIAL_AUTH_GOOGLE_OAUTH2_KEY = d12f['SOCIAL_AUTH_GOOGLE_OAUTH2_KEY']SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET = d12f['SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET']ALLOWED_HOSTS = d12f['ALLOWED_HOSTS']DEBUG = d12f['DEBUG']LOGGING = d12f['LOGGING']Contribute----------If you want to contribute to this project, please perform the following steps.. code-block:: bash# Fork this repository# Clone your forkmkvirtualenv -p python2.7 eckerd-django-google-ssomake developgit co -b feature_branch master# Implement your feature and testsgit add . && git commitgit push -u origin feature_branch# Send us a pull request for your feature branchIn order to run the tests, simply execute ``tox``. This will install two newenvironments (for Django 1.8 and Django 1.9) and run the tests against bothenvironments.