1kastner / jupyterhub-hashauthenticator

Authenticate users with passwords generated from their username.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hash JupyterHub Authenticator

An authenticator for JupyterHub where the password for each user is a secure hash of its username. Useful for environments where it's not suitable for users to authenticate with their Google/GitHub/etc. acconunts.

Installation

pip install jupyterhub-hashauthenticator

Should install it. It has no additional dependencies beyond JupyterHub.

You can then use this as your authenticator by adding the following line to your jupyterhub_config.py:

c.JupyterHub.authenticator_class = 'hashauthenticator.HashAuthenticator
c.HashAuthenticator.secret_key = 'my secret key'

You can generate a good secret key with:

$ openssl rand -hex 32
0fafb0682a493485ed4e764d92abab1199d73246477c5daac7e0371ba541dd66

Generating the password

This package comes with a command called hashauthenticator. Example usage:

$ hashauthenticator
Usage: hashauthenticator secret_key user [len]

$ hashauthenticator my_key pminkov
939fd4

About

Authenticate users with passwords generated from their username.

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Python 100.0%