{ "info": { "author": "DevOps Division, University Information Services, University of Cambridge", "author_email": "raven-support@cam.ac.uk", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python" ], "description": "# Introduction\n\ndjango-ucamwebauth is a library which provides use of Cambridge University's \n[Raven authentication](http://raven.cam.ac.uk/) for [Django](https://www.djangoproject.com/). It provides a Django \nauthentication backend which can be added to `AUTHENTICATION_BACKENDS` in the Django `settings` module.\n\n## Use\n\nInstall django-ucamwebauth using pip:\n\n```bash\npip install django-ucamwebauth\n```\n\nThen you can enable it within your Django project's settings.py:\n\n```python\nAUTHENTICATION_BACKENDS = (\n 'ucamwebauth.backends.RavenAuthBackend',\n 'django.contrib.auth.backends.ModelBackend'\n)\n```\n\nThis allows both normal Django login and Raven login.\n\nYou should then enable the URLs for ucamwebauth:\n\n````python\n#Django 1.11\nurlpatterns = [\n ...\n url(r'', include('ucamwebauth.urls')),\n ...\n]\n\n#Django >=2.0\nurlpatterns = [\n ...\n path(r'', include('ucamwebauth.urls')),\n ...\n]\n````\n\n## Minimum Config Settings\n\nYou then need to configure the app's settings. Raven has a live and test environments, the URL and certificate details \nare given below.\n\nThere are four minimum config settings:\n\n```\nUCAMWEBAUTH_LOGIN_URL: a string representing the URL for the Raven login redirect.\nUCAMWEBAUTH_LOGOUT_URL: a string representing the logout URL for Raven.\nUCAMWEBAUTH_RETURN_URL: the URL of your app which the Raven service should return the user to after authentication.\n (Default is generated automatically from the urlconf)\nUCAMWEBAUTH_LOGOUT_REDIRECT: a string representing the URL to where the user is redirected when she logs out of the app\n (Default to '/').\nUCAMWEBAUTH_NOT_CURRENT: a boolean value representing if raven users that are currently not members of the university\n should be allowed to log in (Default to False). More info: http://www.ucs.cam.ac.uk/accounts/ravenleaving\nUCAMWEBAUTH_CERTS: a dictionary including key names and their associated certificates which can be downloaded from the\n Raven project pages.\nUCAMWEBAUTH_TIMEOUT: An integer with the time (in seconds) that has to pass to consider an authentication timed out\n (Default to 30).\nUCAMWEBAUTH_REDIRECT_AFTER_LOGIN: The url where you want to redirect the user after login (Default to '/').\nUCAMWEBAUTH_CREATE_USER: This defaults to True, allowing the autocreation of users who have been successfully \nauthenticated by Raven, but do not exist in the local database. The user is created with set_unusable_password().\n```\n\nAn example, referencing the Raven test environment is given below:\n\n```python\nUCAMWEBAUTH_LOGIN_URL = 'https://demo.raven.cam.ac.uk/auth/authenticate.html'\nUCAMWEBAUTH_LOGOUT_URL = 'https://demo.raven.cam.ac.uk/auth/logout.html'\nUCAMWEBAUTH_LOGOUT_REDIRECT = 'http://www.cam.ac.uk/'\nUCAMWEBAUTH_CERTS = {901: \"\"\"-----BEGIN CERTIFICATE-----\nMIIDzTCCAzagAwIBAgIBADANBgkqhkiG9w0BAQQFADCBpjELMAkGA1UEBhMCR0Ix\nEDAOBgNVBAgTB0VuZ2xhbmQxEjAQBgNVBAcTCUNhbWJyaWRnZTEgMB4GA1UEChMX\nVW5pdmVyc2l0eSBvZiBDYW1icmlkZ2UxLTArBgNVBAsTJENvbXB1dGluZyBTZXJ2\naWNlIERFTU8gUmF2ZW4gU2VydmljZTEgMB4GA1UEAxMXUmF2ZW4gREVNTyBwdWJs\naWMga2V5IDEwHhcNMDUwNzI2MTMyMTIwWhcNMDUwODI1MTMyMTIwWjCBpjELMAkG\nA1UEBhMCR0IxEDAOBgNVBAgTB0VuZ2xhbmQxEjAQBgNVBAcTCUNhbWJyaWRnZTEg\nMB4GA1UEChMXVW5pdmVyc2l0eSBvZiBDYW1icmlkZ2UxLTArBgNVBAsTJENvbXB1\ndGluZyBTZXJ2aWNlIERFTU8gUmF2ZW4gU2VydmljZTEgMB4GA1UEAxMXUmF2ZW4g\nREVNTyBwdWJsaWMga2V5IDEwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBALhF\ni9tIZvjYQQRfOzP3cy5ujR91ZntQnQehldByHlchHRmXwA1ot/e1WlHPgIjYkFRW\nlSNcSDM5r7BkFu69zM66IHcF80NIopBp+3FYqi5uglEDlpzFrd+vYllzw7lBzUnp\nCrwTxyO5JBaWnFMZrQkSdspXv89VQUO4V4QjXV7/AgMBAAGjggEHMIIBAzAdBgNV\nHQ4EFgQUgjC6WtA4jFf54kxlidhFi8w+0HkwgdMGA1UdIwSByzCByIAUgjC6WtA4\njFf54kxlidhFi8w+0HmhgaykgakwgaYxCzAJBgNVBAYTAkdCMRAwDgYDVQQIEwdF\nbmdsYW5kMRIwEAYDVQQHEwlDYW1icmlkZ2UxIDAeBgNVBAoTF1VuaXZlcnNpdHkg\nb2YgQ2FtYnJpZGdlMS0wKwYDVQQLEyRDb21wdXRpbmcgU2VydmljZSBERU1PIFJh\ndmVuIFNlcnZpY2UxIDAeBgNVBAMTF1JhdmVuIERFTU8gcHVibGljIGtleSAxggEA\nMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEEBQADgYEAsdyB+9szctHHIHE+S2Kg\nLSxbGuFG9yfPFIqaSntlYMxKKB5ba/tIAMzyAOHxdEM5hi1DXRsOok3ElWjOw9oN\n6Psvk/hLUN+YfC1saaUs3oh+OTfD7I4gRTbXPgsd6JgJQ0TQtuGygJdaht9cRBHW\nwOq24EIbX5LquL9w+uvnfXw=\n-----END CERTIFICATE-----\n\"\"\"}\n```\n\n## Errors\n\nThere are five possible exceptions that can be raised using this module: MalformedResponseError, InvalidResponseError,\nPublicKeyNotFoundError, and OtherStatusCode that return HTTP 500, or UserNotAuthorised that returns 403. You can catch \nthese exceptions using process_exception middleware \n(https://docs.djangoproject.com/en/2.2/topics/http/middleware/#process_exception) to customize what the user will \nreceive as a response. The module has a default behaviour for these exceptions with HTTP error codes and using their \ncorresponding templates. To use the default behaviour just add:\n \n```python\nMIDDLEWARE = [\n ...\n 'ucamwebauth.middleware.DefaultErrorBehaviour',\n ...\n]\n\nINSTALLED_APPS = [\n ...\n 'ucamwebauth',\n ...\n]\n```\n\nYou can also rewrite the ucamwebauth_\\.html templates. You only need to add the following lines to your own if \nyou want to show the user the error message:\n\n```python\n{% for message in messages %}\n {{ message }}
\n{% endfor %}\n```\n\n\n## Authentication request parameters\n\nThis parameters are sent with the authentication request and allows the developer to tune the request to fit their app:\n\n```\nUCAMWEBAUTH_DESC: A text description of the resource requesting authentication which may be displayed to the end-user\n to further identify the resource to which his/her identity is being disclosed. Can be omitted.\nUCAMWEBAUTH_IACT: The value 'yes' requires that a re-authentication exchange takes place with the user. This could be\n used prior to a sensitive transaction in an attempt to ensure that a previously authenticated user is still present\n at the browser. The value 'no' requires that the authentication request will only succeed if the user's identity\n can be returned without interacting with the user. This could be used as an optimisation to take advantage of any\n existing authentication but without actively soliciting one. If omitted or empty, then a previously established\n identity may be returned if the WLS supports doing so, and if not then the user will be prompted as necessary.\nUCAMWEBAUTH_MSG: Text describing why authentication is being requested on this occasion which may be displayed to the\n end-user. Can be omitted.\nUCAMWEBAUTH_PARAMS: Data that will be returned unaltered to the WAA in any 'authentication response message' issued as\n a result of this request. This could be used to carry the identity of the resource originally requested or other\n WAA state, or to associate authentication requests with their eventual replies. When returned, this data will be\n protected by the digital signature applied to the authentication response message but nothing else is done to\n ensure the integrity or confidentiality of this data - the WAA MUST take responsibility for this if necessary.\nUCAMWEBAUTH_FAIL: If this parameter is 'yes' and the outcome of the request is anything other than success (i.e. the\n status code would be anything other than 200) then the WLS MUST return an informative error to the user and MUST\n not redirect back to the WAA. Setting this makes it easier to implement WAAs at the expense of a loss of\n flexibility in error handling.\n```\n\nThe details of these can be found in the Raven WLS protocol documentation,\n[here](http://raven.cam.ac.uk/project/waa2wls-protocol.txt).", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://gitlab.developers.cam.ac.uk/uis/devops/django/ucamwebauth", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "django-ucamwebauth", "package_url": "https://pypi.org/project/django-ucamwebauth/", "platform": "", "project_url": "https://pypi.org/project/django-ucamwebauth/", "project_urls": { "Homepage": "https://gitlab.developers.cam.ac.uk/uis/devops/django/ucamwebauth" }, "release_url": "https://pypi.org/project/django-ucamwebauth/1.5.0/", "requires_dist": null, "requires_python": "", "summary": "A Django authentication backend for Ucam-WebAuth a.k.a. Raven", "version": "1.5.0" }, "last_serial": 5413964, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "7e73245193616736f97dc65b9f9baffb", "sha256": "9009537fb2fa25dc8e4ad25f83b4bdaede60e80a29957036a53965b974f36458" }, "downloads": -1, "filename": "django-ucamwebauth-1.0.tar.gz", "has_sig": false, "md5_digest": "7e73245193616736f97dc65b9f9baffb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17416, "upload_time": "2014-07-11T13:56:17", "url": "https://files.pythonhosted.org/packages/78/5f/37670799d4765ed56d4a9b377e8bd8f8bc0519d9fff1bb06bd5a748d2130/django-ucamwebauth-1.0.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "a58e03411e85bbe8e72fe5aad953e9c2", "sha256": "1344b3646100655f8050cd06379396366c104af847a7b388df17fe4a52bb1229" }, "downloads": -1, "filename": "django-ucamwebauth-1.1.tar.gz", "has_sig": false, "md5_digest": "a58e03411e85bbe8e72fe5aad953e9c2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18040, "upload_time": "2014-09-08T11:20:55", "url": "https://files.pythonhosted.org/packages/4d/04/3658b4bd4998887e3212723e4fab425601c6c1d988d51a585bb09240d154/django-ucamwebauth-1.1.tar.gz" } ], "1.2": [ { "comment_text": "", "digests": { "md5": "f93ef113cb8936cc3645712a40f29f48", "sha256": "f89751bba9007da071a070c27b80ce2bb2bc2e203d8061207ec1d164b112ade0" }, "downloads": -1, "filename": "django-ucamwebauth-1.2.tar.gz", "has_sig": false, "md5_digest": "f93ef113cb8936cc3645712a40f29f48", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18106, "upload_time": "2014-09-10T10:59:22", "url": "https://files.pythonhosted.org/packages/be/bf/26d061876c75f8317c7ee7e290f6556424178b8029051ddf66d92fff12c6/django-ucamwebauth-1.2.tar.gz" } ], "1.3": [ { "comment_text": "", "digests": { "md5": "d43304c5e916e4d9972bf23d695ca528", "sha256": "a6761c9688699523000d4bbec9e543a37c735f0b1e002b9e732d33681ed1fbc6" }, "downloads": -1, "filename": "django-ucamwebauth-1.3.tar.gz", "has_sig": false, "md5_digest": "d43304c5e916e4d9972bf23d695ca528", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18460, "upload_time": "2015-03-13T12:04:00", "url": "https://files.pythonhosted.org/packages/2c/0e/bfb26e17c3ce216d9ae415fa7de5327d605b5fb9dfbb6580bb4b569837c0/django-ucamwebauth-1.3.tar.gz" } ], "1.4": [ { "comment_text": "", "digests": { "md5": "869cef13f109b681b3105826c910ce97", "sha256": "f591558748e85ae9a89d1a2e3ffe6e1a301e7c96faa26f457cf53a48e13bcbee" }, "downloads": -1, "filename": "django-ucamwebauth-1.4.tar.gz", "has_sig": false, "md5_digest": "869cef13f109b681b3105826c910ce97", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18502, "upload_time": "2017-07-03T15:29:51", "url": "https://files.pythonhosted.org/packages/43/ad/9ddfb5b37a2d4397c2f45de73f16272cae402f903490183bc970d76158d7/django-ucamwebauth-1.4.tar.gz" } ], "1.4.1": [ { "comment_text": "", "digests": { "md5": "88f4bc2d558b2c8a1f137a5959d40488", "sha256": "b7bc6e4ddf92e96d902753cd8e56ffcbc5e03a252e44b9217d1b9b5bba42e192" }, "downloads": -1, "filename": "django-ucamwebauth-1.4.1.tar.gz", "has_sig": false, "md5_digest": "88f4bc2d558b2c8a1f137a5959d40488", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18507, "upload_time": "2017-07-03T16:01:18", "url": "https://files.pythonhosted.org/packages/37/08/27906aa9a770b4f49ac560d6e8a7ffadd534d844f721562d57d06732b948/django-ucamwebauth-1.4.1.tar.gz" } ], "1.4.2": [ { "comment_text": "", "digests": { "md5": "b1fe33e7c3aaf998f38e566420171dd5", "sha256": "bf0477b58733ab99d6f3206e71bcfc21dd9feee6a7c5b9bc591c132f879337d4" }, "downloads": -1, "filename": "django-ucamwebauth-1.4.2.tar.gz", "has_sig": false, "md5_digest": "b1fe33e7c3aaf998f38e566420171dd5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18499, "upload_time": "2017-07-04T08:03:42", "url": "https://files.pythonhosted.org/packages/d2/0d/85e0a8186a60e6bcefab83f4f93ccd65d5cdaf68a3378eac4cd4899428e6/django-ucamwebauth-1.4.2.tar.gz" } ], "1.4.3": [ { "comment_text": "", "digests": { "md5": "6263280273475b869db7d41bfd5ade5d", "sha256": "abf2ffa1bc2b20feb3accf8103c6863724c7c92173d15f794a6f69dd6c3000ad" }, "downloads": -1, "filename": "django-ucamwebauth-1.4.3.tar.gz", "has_sig": false, "md5_digest": "6263280273475b869db7d41bfd5ade5d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19438, "upload_time": "2017-07-20T09:40:23", "url": "https://files.pythonhosted.org/packages/4e/8f/bb5b217e4050acd5010512c720dd699079d6d96dd382e91c87d5c30aea1b/django-ucamwebauth-1.4.3.tar.gz" } ], "1.4.4": [ { "comment_text": "", "digests": { "md5": "00bcd823e48dc8123fdd44b3994a4ea0", "sha256": "8d1ea1da798f00af2fdae933661f55676c691f0fa6e7b5fe026f095870b76411" }, "downloads": -1, "filename": "django-ucamwebauth-1.4.4.tar.gz", "has_sig": false, "md5_digest": "00bcd823e48dc8123fdd44b3994a4ea0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19474, "upload_time": "2017-08-03T08:28:24", "url": "https://files.pythonhosted.org/packages/24/84/919931ba855bbcde478c92d0703e23bbea6d593f0a000c0c5b8a3883bc90/django-ucamwebauth-1.4.4.tar.gz" } ], "1.4.5": [ { "comment_text": "", "digests": { "md5": "ed5e511f962ca83aa94a2dcf75421217", "sha256": "7f200947a3a6c272870a823e609a9bcf8c3633fb27a478bf39e6228a3ca78691" }, "downloads": -1, "filename": "django-ucamwebauth-1.4.5.tar.gz", "has_sig": false, "md5_digest": "ed5e511f962ca83aa94a2dcf75421217", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19501, "upload_time": "2017-12-13T10:30:17", "url": "https://files.pythonhosted.org/packages/3e/ed/bb5df39b91d5c74e3c375328a46d26d433c21395e0a89814ddb57d49fc3e/django-ucamwebauth-1.4.5.tar.gz" } ], "1.4.6": [ { "comment_text": "", "digests": { "md5": "3d2767875dcd67b366358dba1b5960fb", "sha256": "473df438c2dabafa2613e59abd8383487b93bfd2f4787500b86c0f046b2f2e5e" }, "downloads": -1, "filename": "django-ucamwebauth-1.4.6.tar.gz", "has_sig": false, "md5_digest": "3d2767875dcd67b366358dba1b5960fb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19508, "upload_time": "2018-01-23T10:35:42", "url": "https://files.pythonhosted.org/packages/93/d1/dcfe06c7e4cd226e4bb8367a8613c8435f32ee8378dd5491dde26150162b/django-ucamwebauth-1.4.6.tar.gz" } ], "1.4.7": [ { "comment_text": "", "digests": { "md5": "c97cffedd50286cf3347084cb1b28290", "sha256": "c99084852201999b367677073d4c6116cac1a3aec919f477b6d5aa204672130c" }, "downloads": -1, "filename": "django-ucamwebauth-1.4.7.tar.gz", "has_sig": false, "md5_digest": "c97cffedd50286cf3347084cb1b28290", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19512, "upload_time": "2018-01-23T10:43:16", "url": "https://files.pythonhosted.org/packages/f1/74/be613d85d68d3a2a42ecba144c27989c79dbe617aea6bdfbb967d924faad/django-ucamwebauth-1.4.7.tar.gz" } ], "1.4.8": [ { "comment_text": "", "digests": { "md5": "fa6dbc20e885d121125e12ca82846497", "sha256": "ac4b495c55b0da8902dfe2e2629a8238a27ff912f19a275907ac1f9bdfc9ccfd" }, "downloads": -1, "filename": "django_ucamwebauth-1.4.8-py2-none-any.whl", "has_sig": false, "md5_digest": "fa6dbc20e885d121125e12ca82846497", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 25995, "upload_time": "2018-08-02T16:06:36", "url": "https://files.pythonhosted.org/packages/b5/8a/bc180f9158979f26f4f91ee6e9bbfface91d18ea579edf585fb35ab37fa2/django_ucamwebauth-1.4.8-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b7aff4c5ce28f701b51d7f42f7d9b182", "sha256": "21fb909b46e0a694d6c20d585f3406b1b84e7f20636322b22f5f7227e2ce6905" }, "downloads": -1, "filename": "django-ucamwebauth-1.4.8.tar.gz", "has_sig": false, "md5_digest": "b7aff4c5ce28f701b51d7f42f7d9b182", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19614, "upload_time": "2018-08-02T16:06:37", "url": "https://files.pythonhosted.org/packages/1b/69/219b08f1065fb387e318fac0788526f2e838487b9a9224832d8627be1314/django-ucamwebauth-1.4.8.tar.gz" } ], "1.5.0": [ { "comment_text": "", "digests": { "md5": "16ebfd42e96e179522ba4786a24fa49c", "sha256": "2da4666a695f7b2381a7f8a2f7c6dace34f3cac7d2d94b790d8ff152a66f31ac" }, "downloads": -1, "filename": "django-ucamwebauth-1.5.0.tar.gz", "has_sig": false, "md5_digest": "16ebfd42e96e179522ba4786a24fa49c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17409, "upload_time": "2019-06-18T08:32:16", "url": "https://files.pythonhosted.org/packages/3d/18/c554a9cea85de5c4ad18fabcbb273d79fec1dae09677fcf34f7c53675996/django-ucamwebauth-1.5.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "16ebfd42e96e179522ba4786a24fa49c", "sha256": "2da4666a695f7b2381a7f8a2f7c6dace34f3cac7d2d94b790d8ff152a66f31ac" }, "downloads": -1, "filename": "django-ucamwebauth-1.5.0.tar.gz", "has_sig": false, "md5_digest": "16ebfd42e96e179522ba4786a24fa49c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17409, "upload_time": "2019-06-18T08:32:16", "url": "https://files.pythonhosted.org/packages/3d/18/c554a9cea85de5c4ad18fabcbb273d79fec1dae09677fcf34f7c53675996/django-ucamwebauth-1.5.0.tar.gz" } ] }