-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document user grabbing self auth_state #3588
Comments
Also trying to figure it out, I read quite a few of the questions and issues and also read this page over here; https://github.com/jupyterhub/jupyterhub/blob/main/docs/source/reference/authenticators.md But his bit here confused me, where do I export this. '''export JUPYTERHUB_CRYPT_KEY=$(openssl rand -hex 32)''' Some background, I'm using the helm chart to deploy JupyterLab, and Keycloak as the auth providor. When I deploy this, I could have that ENV variable set via a dockerfile when I build an image of the hub, or in kubernetes in some manner. But would love more info around what happens then when i do a helm upgrade of the chart version, if this number changes per-image that I build of the hub itself. Will that break everything, or will it simply render any tokens already in the database dead/discarded. |
If anyone's hitting this issue looking for docs, this works:
This lets the user see his own auth state, then grants the same to JUPYTERHUB_API_TOKEN, which has the Access the user's auth state from the You could also set the |
it works! |
Made above changes in jupyterhub_config.py file and restarted the jupyterhub and auth_state is returned in API response. Thanks. |
just had a success as well! however, I had to generate a new token. the old ones that were from before the role change don't work |
my bad. ofc the reason is the default token |
As stated in the error message:
listing users requires the If you want this for all users, you need the scopes:
|
for people running into this relevant issue
try to c.JupyterHub.load_roles.extend([
{
"name": "user",
"description": "User Role for accessing auth_state via API",
"scopes": ["self", "admin:auth_state!user"],
"services": [],
}, {
"name": "server",
"description": "Allows parties to start and stop user servers",
"scopes": ["inherit"],
"services":[]
}
]) |
Is the I am encountering an issue where I keep retrieving expired tokens after about 30 minutes. |
If your Authenticator implements |
According to #3189, users should be able to access their own
auth_state
now that RBAC has landed in Jupyterhub 🎉 . Readingauth_state
to get external oauth tokens (e.g. Keycloak access token) is a frequently asked question, and the usual workaround is for the spawner to push that information into the single user instance as an environment variable.I am happy to add a section to https://jupyterhub.readthedocs.io/en/rbac/rbac/use-cases.html if I can figure out how to make
auth_state
available to users on my hub.What I've tried
Running Jupyterhub 1.4.2 in Kubernetes with Keycloak authentication (
GenericOAuthenticator
).auth_state
is enabled and the spawner sets an environment variable for the tokens, that is all good. When I GET<hub-host>/hub/api/user
with headerAuthorization: token <jupyterhub_singleuser_api_token>
, I get back user info (name, servers, etc) but no auth state.Do I need to configure
c.Jupyterhub.load_roles
orload_groups
in some manner to allow users to see their own auth state? Or is there an extra url parameter to/api/user
to specify scope? Something else I'm missing?Thank you.
The text was updated successfully, but these errors were encountered: