No project description provided
Project description
Jupyterhub Authenticators
A bundle of Jupyterhub Authenticators. For now includes a Remote-User auth, Dummy auth and support for passing additional information to the jupyter user. This includes a Mount header.
Installation
Installation from pypi:
pip install jhub-authenticators
Installation from local git repository:
cd jhub-authenticators pip install .
Configuration
You should edit your jupyterhub_config.py config file to set the authenticator class:
c.JupyterHub.authenticator_class = 'jhubauthenticators.RemoteUserAuthenticator'
You should be able to start jupyterhub. The “/login” resource will look for the authenticated user name in the HTTP header “Remote-User”. If found, and not blank, you will be logged in as that user.
Alternatively, you can use RemoteUserLocalAuthenticator:
c.JupyterHub.authenticator_class = 'jhubauthenticators.RemoteUserLocalAuthenticator'
This provides the same authentication functionality but 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.
Dummy Authentication
Provides an option for testing JupyterHub authentication with a dummy authenticator that can have a global preset password for any account:
c.JupyterHub.authenticator_class = 'jhubauthenticators.DummyAuthenticator' c.DummyAuthenticator.password = 'password'
Note! Don’t use in production.
Remote User Authentication extended with Mount capability
Provides the capability to supply the jupyterhub user with additional state information via the /mount path, it accepts a stringified dictionary with a mount key that can later be used to mount that particular user’s homedrive, the extended authenticator can be activated by setting the following option in the jupyterhub config file:
c.JupyterHub.authenticator_class = 'jhubauthenticators.MountRemoteUserAuthenticator'
Beyond providing the Mount header possibility, the authenticator also by default encodes the Remote-User header with ‘b32encode’. The authenticator therefore also provides the possibility of storing the actual value for debugging purposes in the user.real_name variable via the jupyterhub auth_state mechanism of passing information to the spawner as noted on Authenticators.
This adds two base request paths to the jupyterhub web application:
'/login' -> requires a non empty Remote-User header '/mount' -> requires both a non empty Remote-User and Mount header
The expected format of the Mount header is that the passed string can be evaluated to a python dictionary via:
try: mount_header_dict = literal_eval(mount_header)
The internal format of the Mount header is not evaluated, this is dependent on the underlying mount implementation and should be verified there.
Note:
Upon successful parsing of the header, the active jupyterhub user instance is appended with a ‘mount’ property that contains the accepted dictionary header.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for jhub-authenticators-0.0.9.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 73ed0e9f42e77a1f82c2c4d8726f71ea8a5af1741d32726698d7dd42ac1f3b2f |
|
MD5 | ca982d30c51b084aac1ce0cfcdb6f76e |
|
BLAKE2b-256 | 53fb725a4a0035bfeb0a9a5208dce3b6efafc7d9de560fc041ad2e4c2619a457 |
Hashes for jhub_authenticators-0.0.9-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee5ae2a584b385088bbe7c131724fc1f927abffb34c0df488f904cdb6177d2e9 |
|
MD5 | 500f8f610e1d44e222fd7ddb72ac6049 |
|
BLAKE2b-256 | 74324d2277e641bc6555c08d03443f66387364d3d042a258a1ac151f7f094b9e |