This release is a pre-release and may not be stable for production use.
JupyterHub django-session-authenticator - A Django Session Authenticator for JupyterHub
Authenticate to JupyterHub using an active Django login session, which was created by a Django-based service running on a server in the same domain as the JupyterHub service.
Prerequisites
The main purpose of this authenticator is to provide single sign-on (SSO) capability into JupyterHub, in cases where users are already authenticating with a web application based on the Django framework. This is a simpler alternative to a more centralized authentication solution, such as Cognito.
To allow this JupyterHub (and this authenticator) to "see" the session cookie generated by Django:
- Django and JupyterHub must be hosted under the same domain. For example, django.hostname.com and jupyterhub.hostname.com
- Django's SESSION_COOKIE_DOMAIN must be set to allow cross-domain cookies. For example, hostname.com
Note that only MySQL database-backed sessions are supported at present.
Installation
This package can be installed with pip:
pip install django-authenticator-gdaley
Alternately, you can clone the source repository and run:
cd django-authenticator
pip install -e .
Configuration
You should edit your file jupyterhub_config.py to set the authenticator class. The DjangoSessionLocalAuthenticator provides features such as local user creation. If you already have local users then you may use the DjangoSessionAuthenticator authenticator class, as follows:
For authentication and local user creation
c.JupyterHub.authenticator_class = 'djangoauthenticator.djangoauthenticator.DjangoSessionLocalAuthenticator'
This class is derived from LocalAuthenticator and therefore provides features such as the ability to add local accounts through the admin interface if configured to do so.
For authentication of the Django session only
c.JupyterHub.authenticator_class = 'djangoauthenticator.djangoauthenticator.DjangoSessionAuthenticator'
Required configuration
There are a number of configuration settings, which need to be made. The name of the session cookie used by Django is optional. If you are using the default session cookie name ("sessionid"), there is no need to set it here.
# Django session cookie name
c.DjangoSessionAuthenticator.django_session_cookie_name = '<insert-session-cookie-name-here>'
# Django MySQL database hostname
c.DjangoSessionAuthenticator.mysql_hostname = '<insert-db-hostname-here>'
# Django MySQL username
c.DjangoSessionAuthenticator.mysql_username = '<insert-db-username-here>'
# Django MySQL password
c.DjangoSessionAuthenticator.mysql_password = '<insert-db-password-here>'
Issues
If you have any issues or bug reports, all are welcome in the issues section. We'll do our best to respond quickly.
Contribution
If you want to fix the bugs yourself then raise a PR and we'll take a look :)
Metadata
Release files for django-authenticator-gdaley 0.1.5a0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django-authenticator-gdaley-0.1.5a0.tar.gz | 7.9 kB | Without provenance | Details for django-authenticator-gdaley-0.1.5a0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_authenticator_gdaley-0.1.5a0-py3-none-any.whl | Python 3 | none | any | Details for django_authenticator_gdaley-0.1.5a0-py3-none-any.whl |
Total release size: 16.4 kB
Release files / django-authenticator-gdaley-0.1.5a0.tar.gz
| Download URL | django-authenticator-gdaley-0.1.5a0.tar.gz |
|---|---|
| Size | 7.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
da5ffdad3752724df2cef9fe21d132a9998e264cf40aa07ed482e6c988e8fc1e
|
|
BLAKE2b-256 checksum How to use checksums |
7375d84c826012a1d5b998821ca2d4cf768fcc17f5280459581dfb420bde1874
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.5.0 importlib_metadata/3.7.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.2
|
Release files / django_authenticator_gdaley-0.1.5a0-py3-none-any.whl
| Download URL | django_authenticator_gdaley-0.1.5a0-py3-none-any.whl |
|---|---|
| Size | 8.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ce6f90c7774ce90175bb7fe91c733d3662a2e3938d0d4335f49aa5dd0862f83d
|
|
BLAKE2b-256 checksum How to use checksums |
76c1ce1051bda5fcff1ca6d341b777cc8bee44125f8a7316c560da1f6e1eff3d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.5.0 importlib_metadata/3.7.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.2
|
Security for django-authenticator-gdaley 0.1.5a0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.