mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-07 10:04:07 +00:00
21 lines
552 B
Python
21 lines
552 B
Python
import os
|
|
|
|
# get the oauth client's API token.
|
|
# this could come from anywhere
|
|
api_token = os.getenv("JUPYTERHUB_API_TOKEN")
|
|
if not api_token:
|
|
raise ValueError(
|
|
"Make sure to `export JUPYTERHUB_API_TOKEN=$(openssl rand -hex 32)`"
|
|
)
|
|
|
|
# tell JupyterHub to register the service as an external oauth client
|
|
|
|
c.JupyterHub.services = [
|
|
{
|
|
'name': 'external-oauth',
|
|
'oauth_client_id': "service-oauth-client-test",
|
|
'api_token': api_token,
|
|
'oauth_redirect_uri': 'http://127.0.0.1:5555/oauth_callback',
|
|
}
|
|
]
|