diff --git a/src/_nebari/stages/kubernetes_services/template/modules/kubernetes/services/jupyterhub/files/jupyterhub/03-profiles.py b/src/_nebari/stages/kubernetes_services/template/modules/kubernetes/services/jupyterhub/files/jupyterhub/03-profiles.py index b03269448..9ddc0133d 100644 --- a/src/_nebari/stages/kubernetes_services/template/modules/kubernetes/services/jupyterhub/files/jupyterhub/03-profiles.py +++ b/src/_nebari/stages/kubernetes_services/template/modules/kubernetes/services/jupyterhub/files/jupyterhub/03-profiles.py @@ -5,7 +5,6 @@ from pathlib import Path import z2jh -from tornado import gen def base_profile_home_mounts(username): @@ -547,17 +546,12 @@ def preserve_envvars(spawner): return profile -@gen.coroutine -def render_profiles(spawner): +async def render_profiles(spawner): # jupyterhub does not yet manage groups but it will soon # so for now we rely on auth_state from the keycloak # userinfo request to have the groups in the key # "auth_state.oauth_user.groups" - auth_state = yield spawner.user.get_auth_state() - if not auth_state: - if spawner.user.name == "service-account-jupyterhub": - auth_state = yield spawner.authenticator.authenticate_service_account() - + auth_state = await spawner.user.get_auth_state() username = auth_state["oauth_user"]["preferred_username"] # only return the lowest level group name