From 6ca065edb69235cc78c6e19b716ed56b1f1fadad Mon Sep 17 00:00:00 2001 From: Michael Pilosov Date: Thu, 15 Sep 2022 16:48:55 -0600 Subject: [PATCH] switch to github auth --- jupyterhub_config.py | 14 +++++++------- makefile | 3 +++ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/jupyterhub_config.py b/jupyterhub_config.py index 8cb851a..ff59d21 100755 --- a/jupyterhub_config.py +++ b/jupyterhub_config.py @@ -202,19 +202,19 @@ def mount_config_files(self, username='jovyan'): whitelist.add(name) # Authenticate users with GitHub OAuth -# c.JupyterHub.authenticator_class = 'oauthenticator.GitHubOAuthenticator' -# c.GitHubOAuthenticator.oauth_callback_url = os.environ['OAUTH_CALLBACK_URL'] +c.JupyterHub.authenticator_class = 'oauthenticator.GitHubOAuthenticator' +c.GitHubOAuthenticator.oauth_callback_url = os.environ['OAUTH_CALLBACK_URL'] # Authenticate with thedataincubator/jupyterhub-hashauthenticator -c.JupyterHub.authenticator_class = 'hashauthenticator.HashAuthenticator' +# c.JupyterHub.authenticator_class = 'hashauthenticator.HashAuthenticator' # You can generate a good "secret key" by running `openssl rand -hex 32` in terminal. # it is recommended to do this from time-to-time to change passwords (including changing their length) -c.HashAuthenticator.secret_key = os.environ['HASH_SECRET_KEY'] # Defaults to '' -c.HashAuthenticator.password_length = int(os.environ['PASSWORD_LENGTH']) # Defaults to 6 +# c.HashAuthenticator.secret_key = os.environ['HASH_SECRET_KEY'] # Defaults to '' +# c.HashAuthenticator.password_length = int(os.environ['PASSWORD_LENGTH']) # Defaults to 6 # Can find your password by looking at `hashauthpw --length 10 [username] [key]` # If the `show_logins` option is set to `True`, a CSV file containing -#login names and passwords will be served (to admins only) at `/hub/login_list`. -c.HashAuthenticator.show_logins = True # Optional, defaults to False +# login names and passwords will be served (to admins only) at `/hub/login_list`. +# c.HashAuthenticator.show_logins = True # Optional, defaults to False # TLS config #c.JupyterHub.port = 8000 diff --git a/makefile b/makefile index acc3f02..3428946 100755 --- a/makefile +++ b/makefile @@ -21,6 +21,9 @@ secrets/oauth.env: @mkdir -p secrets/ @echo "Generating hash key in $@" @echo "HASH_SECRET_KEY=$(shell openssl rand -hex 32)" > $@ + @echo "OAUTH_CLIENT_SECRET=" >> $@ + @echo "OAUTH_CLIENT_ID=" >> $@ + @echo "OAUTH_CALLBACK_URL=" >> $@ login: @docker run --rm $(HUB_NAME) hashauthpw --length $(PASSWORD_LENGTH) $(USERNAME) $(HASH_SECRET_KEY)