diff --git a/dockerfiles/jupyterhub/jupyterhub_config.py b/dockerfiles/jupyterhub/jupyterhub_config.py index 63a2133..7fe809b 100644 --- a/dockerfiles/jupyterhub/jupyterhub_config.py +++ b/dockerfiles/jupyterhub/jupyterhub_config.py @@ -55,6 +55,9 @@ c.SwarmSpawner.environment.update(environment) c.SwarmSpawner.extra_container_spec = {'user': '0'} +# Issue in JupyterHub 4.0 where cookie auth is not persisted from a token in url authenticated request +c.SwarmSpawner.environment.update({'JUPYTERHUB_SINGLEUSER_EXTENSION': '0'}) + # Spawner config c.JupyterHub.spawner_class = 'dockerspawner.SwarmSpawner' c.Spawner.start_timeout = int(os.environ['JH_START_TIMEOUT']) diff --git a/xnat-jupyterhub-chart/files/pre_spawn_hook.py b/xnat-jupyterhub-chart/files/pre_spawn_hook.py index f53a7ea..e86b39b 100644 --- a/xnat-jupyterhub-chart/files/pre_spawn_hook.py +++ b/xnat-jupyterhub-chart/files/pre_spawn_hook.py @@ -64,6 +64,11 @@ def pre_spawn_hook(spawner): 'NB_USER': f'{spawner.user.name}' }) + # Issue in JupyterHub 4.0 where cookie auth is not persisted from a token in url authenticated request + spawner.environment.update({ + 'JUPYTERHUB_SINGLEUSER_EXTENSION': '0' + }) + if 'mounts' in container_spec: logger.debug( f'Adding mounts to user {spawner.user.name} server {spawner.name} from XNAT. Mounts: {container_spec["mounts"]}')