Hi there,
I’m working with Jupyterhub Collaboration following this doc. In the example of this doc, the members and groups are hard-coded:
projects:
vox:
members:
- vex
- vax
- pike
mighty:
members:
- fjord
- beau
- jester
In order to not hard-code all the groups and users here, I have a GenericAuthenticator defined, and I expect the Jupyterhub RBAC’s group = Authenticator’s group, but it seems like this is not the case:
GenericOAuthenticator:
client_id: *
client_secret: *
oauth_callback_url: *
authorize_url: *
token_url: *
userdata_url: *
login_service: Test
username_claim: preferred_username
enable_auth_state: true
scope:
- openid
claim_groups_key: groups
admin_groups:
- admin_group
allow_all: true
JupyterHub:
authenticator_class: generic-oauth
profile_map = {
## I use OAuth group name as profile key
'jhub_collaboration': make_profile(
display_name='JupyterHub Collaboration',
description='JupyterHub Collaboration Environment',
)
}
## Create collaboration users
c.JupyterHub.load_roles = []
c.JupyterHub.load_groups = {
# collaborative accounts get added to this group
# so it's easy to see which accounts are collaboration accounts
"collaborative": [],
}
for profile_key in profile_map.keys(): ## I use OAuth group name as profile key
# define a new user for the collaboration
collab_user = f"{profile_key}_collab"
# add the collab user to the 'collaborative' group
# so we can identify it as a collab account
c.JupyterHub.load_groups["collaborative"].append(collab_user)
# finally, grant members of the project collaboration group
# access to the collab user's server,
# and the admin UI so they can start/stop the server
c.JupyterHub.load_roles.append(
{
"name": f"collab-access-{profile_key}",
"scopes": [
f"access:servers!user={collab_user}",
f"admin:servers!user={collab_user}",
"admin-ui",
f"list:users!user={collab_user}",
],
"groups": [profile_key], ## I use OAuth group name as profile key
}
)
Are Jupyterhub groups
and OAuth groups
totally different? Is there a way to link/sync them? Can Jupyterhub RBAC to assign role based on OAuth groups?