Hey there,
Since I’m currently writing a custom JupyterHub service, I ran into the issue that the modified groups of an already logged-in user are not visible to the service.
This is most likely because the service already authenticated the user, and the group has not yet been assigned.
As a “workaround,” the user has to log out and log in again. Thus, the service receives a new token containing the updated groups.
As another alternative, I assume that I could use the JupyterHub’s REST API to get the current groups.
Is this the intended way, or do I miss something?
By the way, I use the service whoami to test it.
class WhoAmIHandler(HubAuthenticated, RequestHandler):
@authenticated
def get(self):
user_model = self.get_current_user()
self.set_header('content-type', 'application/json')
self.write(json.dumps(user_model, indent=1, sort_keys=True))
Best regards,
Paul