Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

CRC JupyterHub Authenticator

The crc_jupyter_auth package is a Jupyter authentication plugin for redirecting users based on their account status and VPN role. The utility is based on the jhub_remote_user_authenticator package originally created for more general applications. The CRC version builds on the original utility by providing significantly improved test coverage and a refined set of configuration options.

How It Works

The authentication plugin checks incoming authentication requests and routes users based on the associated header values. The name of the inspected headers and the routing destination are configurable via the standard Jupyter config file.

Installation and Setup

The crc_jupyter_auth package can be installable via the pip package manager.

pip install crc-jupyter-auth

After installing the package, you will need to update the authenticator_class option in your Jupyter configuration file. To enable basic authentication capabilities and request routing, specify the RemoteUserAuthenticator class:

c.JupyterHub.authenticator_class = "crc_jupyter_auth.RemoteUserAuthenticator"

To enable the same functionality plus local account management, use RemoteUserLocalAuthenticator:

c.JupyterHub.authenticator_class = "crc_jupyter_auth.RemoteUserLocalAuthenticator"

The RemoteUserLocalAuthenticator class provides the same authentication functionality as RemoteUserAuthenticator but is derived from Jupyter's built-in LocalAuthenticator class. This provides extra features such as the ability to add local accounts through the admin interface.

Package Configuration

The authenticator works by fetching the authenticated username from the HTTP header Cn. If found, and not blank, the client will be logged in as that user. Otherwise, the user is redirected.

The HTTP header names and failure redirects are configurable via the Jupyter settings file. Setting names and default values are provided in the table below:

Setting Name Default Description
username_header "Cn" HTTP header name to inspect for the authenticated username -
vpn_header "isMemberOf" HTTP header name to inspect for the user VPN role(s).
required_vpn_role "" Required VPN role for accessing the service. Ignored if an empty string.
missing_role_redirect "" Redirect URL if the user is missing the required VPN header. Defaults to 404 if empty string.

To modify a settings value, use the c.Authenticator object in the configuration file. For example:

c.Authenticator.missing_role_redirect = "https://my.redirect.domain"

If your system assigns multiple VPN roles to users and more than a single role is reported by the header vpn_header, the VPN roles should be provided in the header as a semicolon-delimited list (e.g., role1;role2).

Architecture and Security Recommendations

This authenticator relies on HTTP headers that can be spoofed by a malicious client. To protect against this, an authenticating proxy should be placed in front of Jupyterhub. The JupyterHub daemon should only be accessible from the proxy and never directly accessible by a client.

The authenticating proxy should remove any HTTP headers from incoming requests and only apply headers to proxied requests that have been properly authenticated.

Metadata

Release files for crc-jupyter-auth 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for crc-jupyter-auth 1.1.0
File Size Uploaded Provenance
crc_jupyter_auth-1.1.0.tar.gz 16.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for crc-jupyter-auth 1.1.0
File Interpreter ABI Platform
crc_jupyter_auth-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 33.7 kB

Release files / crc_jupyter_auth-1.1.0.tar.gz

Download URL crc_jupyter_auth-1.1.0.tar.gz
Size 16.4 kB
Tags Source
SHA-256 checksum
How to use checksums
a84788c24de54be2a82cb3bf5b9b9f1dc1f3eb464fcf562d6cf8771891e560fb
BLAKE2b-256 checksum
How to use checksums
730ad0f477cc7f771884a6b71a59355b8825efd508def7d5d1e20dce9052569f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / crc_jupyter_auth-1.1.0-py3-none-any.whl

Download URL crc_jupyter_auth-1.1.0-py3-none-any.whl
Size 17.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c1b0b5129ae074b2deffe5eda4518bad1f91b7fffa1895a9eb71e1cba6395627
BLAKE2b-256 checksum
How to use checksums
d3f1f4475a7e908d0a4a1ddf2eeae15e95062aa84f5eea2ba380884abf373c8d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Security for crc-jupyter-auth 1.1.0

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page