By default, BinderHub runs without authentication, creating a temporary user for each launch. To enable authentication via JupyterHub, update your config.yaml to enable authentication in both the BinderHub config and the BinderSpawner. You must also configure the jupyterhub.hub.config with your desired authenticator class and its specific configuration.
Important Requirements:
- Ensure
jupyterhub-singleuser is used in the singleuser.cmd setting. jupyterhub-singleuser requires JupyterHub to be installed in your user server images. It is recommended to use at least jupyter/repo2docker:ccce3fe to ensure repo2docker installs JupyterHub automatically.
config:
BinderHub:
auth_enabled: true
jupyterhub:
cull:
# don't cull authenticated users (reverts binderhub chart's default)
users: false
hub:
config:
BinderSpawner:
auth_enabled: true
JupyterHub:
redirect_to_server: false
# specify the desired authenticator
authenticator_class: <desired-authenticator>
# use config of your authenticator here
Authenticator: {}
<desired-authenticator-class>: {}
services:
binder:
oauth_client_id: service-binderhub
oauth_no_confirm: true
oauth_redirect_uri: "https://<binderhub_url>/oauth_callback"
loadRoles:
user:
scopes:
- self
- "access:services!service=binder"
singleuser:
# make notebook servers aware of hub
cmd: jupyterhub-singleuser