From 3865df7db0000b893cd1292721c5ac5901af68d4 Mon Sep 17 00:00:00 2001 From: YuviPanda Date: Wed, 6 Sep 2023 09:41:24 -0700 Subject: [PATCH] Move boilerplate to the bottom --- examples/external-oauth/jupyterhub_config.py | 25 +++++++++++--------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/examples/external-oauth/jupyterhub_config.py b/examples/external-oauth/jupyterhub_config.py index 7b3f86d6..c8fbb795 100644 --- a/examples/external-oauth/jupyterhub_config.py +++ b/examples/external-oauth/jupyterhub_config.py @@ -1,16 +1,5 @@ import os -# Allow anyone to authenticate -from jupyterhub.auth import DummyAuthenticator - -c.JupyterHub.authenticator_class = DummyAuthenticator - -# Optionally set a global password that all users must use -# c.DummyAuthenticator.password = "your_password" - -# only listen on localhost for testing. -c.JupyterHub.bind_url = 'http://127.0.0.1:8000' - # get the oauth client's API token. # this could come from anywhere api_token = os.getenv("JUPYTERHUB_API_TOKEN") @@ -38,3 +27,17 @@ c.JupyterHub.load_roles = [ } ] + +# Boilerplate to make sure the example runs - this is not relevant +# to external oauth services. + +# Allow authentication with any username and any password +from jupyterhub.auth import DummyAuthenticator + +c.JupyterHub.authenticator_class = DummyAuthenticator + +# Optionally set a global password that all users must use +# c.DummyAuthenticator.password = "your_password" + +# only listen on localhost for testing. +c.JupyterHub.bind_url = 'http://127.0.0.1:8000'