Hi,
I am working with Jupyterhub, and have developed my own custom LocalAuthenticator to authenticate users based on our in-house authentication method. Depending on the user that logs in, we are spinning up a separate notebook server for them, the name of this user’s server is determined from a combination of their name and other details. So this means that at the time of setting up Jupyterhub, I do not have access to all the users that may or may not access Jupyterhub.
Given the above context, I would like to assign some users (let’s say all users beginning with the letter “n”) as admins, during the time of authentication. This means that at the time of setting up Jupyterhub, I don’t know who these users are - so I cannot populate the admin_users set within jupyterhub_config.py file. I was unable to find much online as to how I can achieve this.
I’ve tried this - I’ve hardcoded an admin user “jhubuser” within the config file, and during the time of authentication, I check for some condition, and if that matches, I redirect them to the “jhubuser” server, which is already designated as an admin user. However, this has other problems - if multiple users match the condition, then all those users will be directed to the “jhubuser” notebook server from their individual browsers. which means our in-house authentication logic fails due to multiple user-cookies pointing to the same user.
So… TL;DR - is there a way I can set a particular user to be an admin user while I am inside the custom authenticator class?
Thanks for your help in advance!