Skip to content
This repository has been archived by the owner on Jan 13, 2023. It is now read-only.

Latest commit

 

History

History
56 lines (38 loc) · 1.7 KB

File metadata and controls

56 lines (38 loc) · 1.7 KB

JupyterHub authenticator for Google Cloud proxies.

User authenticator that enable Google Cloud user to login to JupyterHub using an identity transfered by one of the following:

Install

pip install git+https://GoogleCloudPlatform/jupyterhub-gcp-proxies-authenticator

Usage

Inverting Proxy

# Imports authenticator.
from gcpproxiesauthenticator.gcpproxiesauthenticator import GCPProxiesAuthenticator

# Sets JupyterHub authenticator.
c.JupyterHub.authenticator_class = GCPProxiesAuthenticator

# Specifies header that contains user identity.
c.GCPProxiesAuthenticator.check_header = "X-Inverting-Proxy-User-Id"

# Shows this JupyterHub page template after login.
c.GCPProxiesAuthenticator.template_to_render = "welcome.html"

Cloud IAP

# Imports authenticator.
from gcpproxiesauthenticator.gcpproxiesauthenticator import GCPProxiesAuthenticator

# Sets JupyterHub authenticator.
c.JupyterHub.authenticator_class = GCPProxiesAuthenticator

# Specifies header that contains user identity.
c.GCPProxiesAuthenticator.check_header = "X-Goog-IAP-JWT-Assertion"

# Contains alphanumerical and hyphens.
c.GCPProxiesAuthenticator.project_id = project_id

# Contains numbers only.
c.GCPProxiesAuthenticator.project_number = project_number

# Backend service of the application protected by Cloud IAP
c.GCPProxiesAuthenticator.backend_service_name = backend_service_name

# Shows this JupyterHub page template after login.
c.GCPProxiesAuthenticator.template_to_render = "welcome.html"