How to configure JupyterLab authentication


I’m running JupyterHub + BatchSpawner for Slurm + JupyterLab on Ubuntu 18.04.
The JupyterHub PAM authentication works fine.
The BatchSpawner for Slurm creates the JupyterLab notebook which runs on another node. The user then gets access to ,the JupyterLab main page, without being asked to enter a password. JupyterLab then runs fine.
For security reasons in my company, I’d like to implement a password authentication for JupyterLab, but I can’t see how to do it.

My setup is:

  • OS: Ubuntu 18.04
  • Configuration: JupyterHub 1.2.2 + BatchSpawner for Slurm (20.11.0) + JupyterLab 2.2.9
  • in c.Spawner.cmd = [‘jupyterhub-singleuser’] and c.Spawner.default_url = ‘/lab’
  • in ~/.jupyter, I’ve configured c.NotebookApp.password and I’ve run the ‘jupyter notebook password’ command.

Thanks a lot,