{ "info": { "author": "Brown University Library", "author_email": "bdr@brown.edu", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "django-shibboleth-remoteuser\n============================\n\n|build-status|\n\nMiddleware for using Shibboleth with Django.\nRequires Django 1.3 or above for RemoteAuthMiddleware.\n\nRequirements\n------------\n\n* shibboleth-sp service installed on your system\n* shibboleth module enabled or compiled on your web server\n* Django >= 1.8 for version > 0.6 or Django > 1.3 for version <= 0.6\n\nInstallation and configuration\n------------------------------\n1. Either checkout and run ``python setup.py install`` or install directly\n from GitHub using ``pip``:\n\n .. code-block:: bash\n\n pip install git+https://github.com/Brown-University-Library/django-shibboleth-remoteuser.git\n\n2. In ``settings.py``:\n\n * Enable the RemoteUserBackend.\n\n .. code-block:: python\n\n AUTHENTICATION_BACKENDS += (\n 'shibboleth.backends.ShibbolethRemoteUserBackend',\n )\n\n * Add the Django Shibboleth middleware.\n You must add\n ``django.contrib.auth.middleware.ShibbolethRemoteUserMiddleware``\n to the ``MIDDLEWARE_CLASSES`` setting after\n ``django.contrib.auth.middleware.AuthenticationMiddleware``.\n For example:\n\n .. code-block:: python\n\n MIDDLEWARE_CLASSES = (\n ...\n 'django.contrib.auth.middleware.AuthenticationMiddleware',\n 'shibboleth.middleware.ShibbolethRemoteUserMiddleware',\n ...\n )\n\n * Map Shibboleth attributes to Django User models.\n The attributes must be stated in the form they have in the HTTP headers.\n Use this to populate the Django User object from Shibboleth attributes.\n\n The first element of the tuple states if the attribute is required or not.\n If a required element is not found in the parsed Shibboleth headers,\n an exception will be raised. For example, ``(True, \"required_attribute\")``,\n ``(False, \"optional_attribute)``.\n\n .. code-block:: python\n\n SHIBBOLETH_ATTRIBUTE_MAP = {\n \"shib-user\": (True, \"username\"),\n \"shib-given-name\": (True, \"first_name\"),\n \"shib-sn\": (True, \"last_name\"),\n \"shib-mail\": (False, \"email\"),\n }\n\n * Set the ``LOGIN_URL`` to the login handler of your Shibboleth installation.\n In most cases, this will be something like:\n\n .. code-block:: python\n\n LOGIN_URL = 'https://your_domain.edu/Shibboleth.sso/Login'\n\n3. Apache configuration - make sure the Shibboleth attributes are available\n to the app. The app url doesn't need to require Shibboleth.\n\n .. code-block:: xml\n\n \n AuthType shibboleth\n Require shibboleth\n \n\n\nVerify configuration\n--------------------\nIf you would like to verify that everything is configured correctly,\nfollow the next two steps below. It will create a route in your application\nat ``/yourapp/shib/`` that echos the attributes obtained from Shibboleth.\nIf you see the attributes you mapped above on the screen, all is good.\n\n* Add shibboleth to installed apps.\n\n .. code-block:: python\n\n INSTALLED_APPS += (\n 'shibboleth',\n )\n\n\n* Add below to ``urls.py`` to enable the included sample view.\n This view just echos back the parsed user attributes,\n which can be helpful for testing.\n\n .. code-block:: python\n\n urlpatterns += [\n url(r'^shib/', include('shibboleth.urls', namespace='shibboleth')),\n ]\n\n\nAt this point, the django-shibboleth-remoteuser middleware should be complete.\n\nOptional\n--------\n\nTemplate tags\n~~~~~~~~~~~~~\n\nTemplate tags are included which will allow you to place ``{{ login_link }}``\nor ``{{ logout_link }}`` in your templates for routing users to the\nlogin or logout page. These are available as a convenience and are not required.\nTo activate, add the following to ``settings.py``:\n\n.. code-block:: python\n\n TEMPLATES = [\n {\n ...\n 'OPTIONS': {\n 'context_processors': [\n ...\n 'shibboleth.context_processors.login_link',\n 'shibboleth.context_processors.logout_link',\n ...\n ],\n },\n ...\n },\n ]\n\n\nPermission group mapping\n~~~~~~~~~~~~~~~~~~~~~~~~\n\nIt is possible to map a list of attributes to Django permission groups.\n``django-shibboleth-remoteuser`` will generate the groups from the\nsemicolon-separated values of these attributes. They will be available\nin the Django admin interface and you can assign\nyour application permissions to them.\n\n.. code-block:: python\n\n SHIBBOLETH_GROUP_ATTRIBUTES = ['Shibboleth-affiliation', 'Shibboleth-isMemberOf']\n\nBy default this value is empty and will not affect your group settings.\nBut when you add attributes to ``SHIBBOLETH_GROUP_ATTRIBUTES``\nthe user will only associated with those groups. Be aware that the user\nwill be removed from groups not defined in ``SHIBBOLETH_GROUP_ATTRIBUTES``,\nif you enable this setting. Some installations may create a lot of groups.\nYou may check your group attributes at\n``https://your_domain.edu/Shibboleth.sso/Session``\nbefore activating this feature.\n\n\nFields identified in ``SHIBBOLETH_GROUP_ATTRIBUTES`` can be a string of group\nnames with a delimiter. By default the delimiter is `;`, but this can be\noverridden to be one or many delimiters using the ``SHIBBOLETH_GROUP_DELIMITERS``\nsetting.\n\nFor example, given:\n - ``SHIBBOLETH_GROUP_ATTRIBUTES = ['Shibboleth-isMemberOf']``\n - request headers includes: ``Shibboleth-isMemberOf: 'users;admins,managers'``\n\n=========================== =======================================\nSHIBBOLETH_GROUP_DELIMITERS Parsed Groups\n=========================== =======================================\ndefault ``users`` and ``admins,managers``\n``[',']`` ``users;admins`` and ``managers``\n``[',', ';']`` ``users``, ``admins``, and ``managers``\n=========================== =======================================\n\n.. |build-status| image:: https://travis-ci.org/Brown-University-Library/django-shibboleth-remoteuser.svg?branch=master&style=flat\n :target: https://travis-ci.org/Brown-University-Library/django-shibboleth-remoteuser\n :alt: Build status\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Brown-University-Library/django-shibboleth-remoteuser", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "django-shibboleth-remoteuser", "package_url": "https://pypi.org/project/django-shibboleth-remoteuser/", "platform": "", "project_url": "https://pypi.org/project/django-shibboleth-remoteuser/", "project_urls": { "Homepage": "https://github.com/Brown-University-Library/django-shibboleth-remoteuser" }, "release_url": "https://pypi.org/project/django-shibboleth-remoteuser/0.11/", "requires_dist": null, "requires_python": "", "summary": "", "version": "0.11" }, "last_serial": 5983745, "releases": { "0.11": [ { "comment_text": "", "digests": { "md5": "bc0eb5d64cf27648a84639078fc938ec", "sha256": "c539fd86a39ec60d84dc49d44a83752afec8cca1dfa33871fd22d253618576d8" }, "downloads": -1, "filename": "django_shibboleth_remoteuser-0.11-py3-none-any.whl", "has_sig": false, "md5_digest": "bc0eb5d64cf27648a84639078fc938ec", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 43221, "upload_time": "2019-10-16T14:29:06", "url": "https://files.pythonhosted.org/packages/89/6d/ff35e59c48a7218f47978b0ad210390832b09014f4107bed469831e859c4/django_shibboleth_remoteuser-0.11-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b3f61047ccd62c213e1a0dcc5f7ef55b", "sha256": "8aa42efded73455aac87c7c62827e7f073107f782bc394c685c08c343f493f7b" }, "downloads": -1, "filename": "django-shibboleth-remoteuser-0.11.tar.gz", "has_sig": false, "md5_digest": "b3f61047ccd62c213e1a0dcc5f7ef55b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21774, "upload_time": "2019-10-16T14:29:21", "url": "https://files.pythonhosted.org/packages/7a/7e/5826027d40b6599bd8d3d9873a4a6069158e28423a98d6a4076ff72a9301/django-shibboleth-remoteuser-0.11.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "bc0eb5d64cf27648a84639078fc938ec", "sha256": "c539fd86a39ec60d84dc49d44a83752afec8cca1dfa33871fd22d253618576d8" }, "downloads": -1, "filename": "django_shibboleth_remoteuser-0.11-py3-none-any.whl", "has_sig": false, "md5_digest": "bc0eb5d64cf27648a84639078fc938ec", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 43221, "upload_time": "2019-10-16T14:29:06", "url": "https://files.pythonhosted.org/packages/89/6d/ff35e59c48a7218f47978b0ad210390832b09014f4107bed469831e859c4/django_shibboleth_remoteuser-0.11-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b3f61047ccd62c213e1a0dcc5f7ef55b", "sha256": "8aa42efded73455aac87c7c62827e7f073107f782bc394c685c08c343f493f7b" }, "downloads": -1, "filename": "django-shibboleth-remoteuser-0.11.tar.gz", "has_sig": false, "md5_digest": "b3f61047ccd62c213e1a0dcc5f7ef55b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21774, "upload_time": "2019-10-16T14:29:21", "url": "https://files.pythonhosted.org/packages/7a/7e/5826027d40b6599bd8d3d9873a4a6069158e28423a98d6a4076ff72a9301/django-shibboleth-remoteuser-0.11.tar.gz" } ] }