Metadata-Version: 2.1
Name: django-authenticator-gdaley
Version: 0.1.3a0
Summary: Authenticate to JupyterHub using an active Django login session
Home-page: https://github.com/Codicy/django-authenticator
Author: Graham Daley
Author-email: gd@codicy.co
License: UNKNOWN
Project-URL: Bug Tracker, https://github.com/Codicy/django-authenticator/issues
Keywords: jupyterhub,django
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE

# 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

## Installation

This package can be installed with pip:

```
pip install jupyterhub-django-session-authenticator
```

Alternately, you can clone this repository and run:

```
cd jupyterhub-django-session-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>'
```

## 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 :)

