{ "info": { "author": "Ryan Castner", "author_email": "castner.rr@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Framework :: Django", "Framework :: Django :: 1.10", "Framework :: Django :: 1.8", "Framework :: Django :: 1.9", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5" ], "description": "=============================\nDjango Shib Auth RIT\n=============================\n\n.. image:: https://badge.fury.io/py/django-shibauth-rit.svg\n :target: https://badge.fury.io/py/django-shibauth-rit\n\n.. image:: https://travis-ci.org/audiolion/django-shibauth-rit.svg?branch=master\n :target: https://travis-ci.org/audiolion/django-shibauth-rit\n\n.. image:: https://codecov.io/gh/audiolion/django-shibauth-rit/branch/master/graph/badge.svg\n :target: https://codecov.io/gh/audiolion/django-shibauth-rit\n\nIntegrate Shibboleth Authentication with your RIT projects\n\nQuickstart\n----------\n\nInstall Django Shib Auth RIT::\n\n pip install django-shibauth-rit\n\nAdd it to your `INSTALLED_APPS`:\n\n.. code-block:: python\n\n INSTALLED_APPS = (\n ...\n 'shibauth_rit',\n ...\n )\n\nAdd the authentication backend:\n\n.. code-block:: python\n\n AUTHENTICATION_BACKENDS = [\n 'shibauth_rit.backends.ShibauthRitBackend',\n ...\n ]\n\nAdd the middleware to process requests:\n\n.. code-block:: python\n\n # use MIDDLEWARE_CLASSES on Django 1.8\n MIDDLEWARE = (\n ...\n 'django.contrib.auth.middleware.AuthenticationMiddleware',\n 'shibauth_rit.middleware.ShibauthRitMiddleware',\n ...\n )\n\nAdd Django Shib Auth RIT's URL patterns:\n\n.. code-block:: python\n\n urlpatterns = [\n ...\n url(r'^', include('shibauth_rit.urls')),\n ...\n ]\n\nSet the `LOGIN_URL` setting to the login handler of RIT's Shibboleth installation:\n\n.. code-block:: python\n\n LOGIN_URL = 'https:///Shibboleth.sso/Login'\n\nMap Shibboleth's return attributes to your user model:\n\n.. code-block:: python\n\n SHIBAUTH_ATTRIBUTE_MAP = {\n 'uid': (True, 'username'),\n 'mail': (False, 'email'),\n }\n\nShibboleth returns a number of attributes after a successful authentication. According to RIT's\ndocs the current attributes returned are:\n\n.. code-block::\n uid - the user's RIT username\n givenName - the user's given (first) name\n sn -the user's surname (last/family name)\n mail - the user's email address (note that this can be null)\n ritEduMemberOfUid - groups the account is a member of (Ex: forklift-operators, vendingmach-admins, historyintegrator, etc.)\n ritEduAffiliation - multi-valued attribute showing relationship to RIT (Ex: Student, Staff, StudentWorker, Adjust, Retiree etc.)\n\nNote: Additional attributes can be configured on a site-by-site basis. Please contact the ITS Service Desk with requests for additional attributes.\n\nWhen you map attributes, you use a Tuple of `(Boolean, 'UserModelField')` where `Boolean` indicates if the field is `REQUIRED`. This should match your\nUser model's requirements. If your User model is as follow:\n\n.. code-block:: python\n\n class User(AbstractBaseUser, PermissionsMixin):\n USERNAME_FIELD = 'email'\n EMAIL_FIELD = 'email'\n\n email = models.EmailField(_('email address'), unique=True, blank=True, null=True)\n username = models.CharField(_('username'), unique=True, required=True, max_length=50)\n name = models.CharField(_('Name of User'), blank=True, max_length=100)\n\nThen `username` is a required attribute and should be `'uid': (True, 'username')` but email is not\nrequired and should be `'mail': (False, 'email')`.\n\nNote: If email is a required field on your model, shibboleth doesn't guarantee that `mail` will be populated so you will need to handle that exception. You can do this by subclassing `ShibauthRitBackend` and overriding `handle_parse_exception()` method. See [Subclassing ShibauthRitBackend]().\n\n.htaccess Setup\n---------------\n\nThis package requires your site to be hosted on RIT's servers. The .htaccess should look like this\n\n.. code-block:: apache\n\n # Ensure https is on. required for shibboleth auth\n RewriteCond ${HTTPS} off\n RewriteRule (.*) https://%{HTTP_HOST} [R,L]\n\n # Two options, lazy loading where people do not need to authenticate to get to your site\n \n SSLRequireSSL\n AuthType shibboleth\n Require shibboleth\n ShibRequestSetting requireSession false\n ShibRedirectToSSL 443\n \n\n # Or no lazy loading, strict requirement of shib authentication before accesing site\n \n SSLRequireSSL\n AuthType shibboleth\n ShibRequireSession On\n require valid-user\n # see https://www.rit.edu/webdev/authenticating-and-authorizing-rit-users for other require options\n \n\nThis sets up some stuff with the Apache webserver so when people go to https:///Shibboleth.sso/Login it initiates the redirect to RIT's Shibboleth logon. Don't put a url route there, though I think Apache would always pick it up before it got to your code, might as well not mess with it.\n\nContext Processors\n------------------\n\nThere are two context processors included which allow you to place `{{ login_link }}` or `{{ logout_link }}` in your templates for routing users to the login or logout page. These are available as a convenience and are not required. To activate, add the following to your settings:\n\n.. code-block:: python\n\n TEMPLATES = [\n {\n ...\n 'OPTIONS': {\n 'context_processors': [\n ...\n 'shibauth_rit.context_processors.login_link',\n 'shibauth_rit.context_processors.logout_link',\n ...\n ],\n },\n ...\n },\n ]\n\n\nRunning Tests\n-------------\n\nTo do a simple test run with your current config\n\n.. code-block:: bash\n\n $ python runtests.py\n\nTo comprehensively test the suite across versions of python and django\n\n.. code-block:: bash\n\n source /bin/activate\n (myenv) $ pip install tox\n (myenv) $ tox\n\n\nCredits\n-------\n\nTools used in rendering this package:\n\n* Cookiecutter_\n* `cookiecutter-djangopackage`_\n\n.. _Cookiecutter: https://github.com/audreyr/cookiecutter\n.. _`cookiecutter-djangopackage`: https://github.com/pydanny/cookiecutter-djangopackage\n\n\n\n\nHistory\n-------\n\n0.1.0 (2017-02-15)\n++++++++++++++++++\n\n* First release on PyPI.\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/audiolion/django-shibauth-rit", "keywords": "django-shibauth-rit", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "django-shibauth-rit", "package_url": "https://pypi.org/project/django-shibauth-rit/", "platform": "", "project_url": "https://pypi.org/project/django-shibauth-rit/", "project_urls": { "Homepage": "https://github.com/audiolion/django-shibauth-rit" }, "release_url": "https://pypi.org/project/django-shibauth-rit/1.1.0/", "requires_dist": null, "requires_python": "", "summary": "Integrate Shibboleth Authentication with your RIT projects", "version": "1.1.0" }, "last_serial": 2910794, "releases": { "1.1.0": [ { "comment_text": "", "digests": { "md5": "de5fc5e0c2ccb403c3301b8f09c852dc", "sha256": "a407a24c133ce56ac76c63375b6d4d508b6c20b2b68eadad38ad14a8020068cf" }, "downloads": -1, "filename": "django_shibauth_rit-1.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "de5fc5e0c2ccb403c3301b8f09c852dc", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 16386, "upload_time": "2017-05-30T20:45:32", "url": "https://files.pythonhosted.org/packages/f0/64/b03dbc078fd2ae5a609805e63ac5f2b20a1c0809b5d720cedf925013f43a/django_shibauth_rit-1.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9ce343fbd8be27589dcce1f833622a0c", "sha256": "44896b1afe5a7864c7f41a0e5b71694a36b40c216608ab93d905c639200244f1" }, "downloads": -1, "filename": "django-shibauth-rit-1.1.0.tar.gz", "has_sig": false, "md5_digest": "9ce343fbd8be27589dcce1f833622a0c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12828, "upload_time": "2017-05-30T20:45:30", "url": "https://files.pythonhosted.org/packages/41/15/8a40063f439bf4c5aa290dfc167cf915e40f22c94ccc630cd98c1c6accfe/django-shibauth-rit-1.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "de5fc5e0c2ccb403c3301b8f09c852dc", "sha256": "a407a24c133ce56ac76c63375b6d4d508b6c20b2b68eadad38ad14a8020068cf" }, "downloads": -1, "filename": "django_shibauth_rit-1.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "de5fc5e0c2ccb403c3301b8f09c852dc", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 16386, "upload_time": "2017-05-30T20:45:32", "url": "https://files.pythonhosted.org/packages/f0/64/b03dbc078fd2ae5a609805e63ac5f2b20a1c0809b5d720cedf925013f43a/django_shibauth_rit-1.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9ce343fbd8be27589dcce1f833622a0c", "sha256": "44896b1afe5a7864c7f41a0e5b71694a36b40c216608ab93d905c639200244f1" }, "downloads": -1, "filename": "django-shibauth-rit-1.1.0.tar.gz", "has_sig": false, "md5_digest": "9ce343fbd8be27589dcce1f833622a0c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12828, "upload_time": "2017-05-30T20:45:30", "url": "https://files.pythonhosted.org/packages/41/15/8a40063f439bf4c5aa290dfc167cf915e40f22c94ccc630cd98c1c6accfe/django-shibauth-rit-1.1.0.tar.gz" } ] }