Skip to content
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

Add how-to doc on refresh tokens #778

Merged
merged 4 commits into from
Dec 3, 2024
Merged

Conversation

minrk
Copy link
Member

@minrk minrk commented Dec 2, 2024

docs for #579

it would be nice to do a 17.2 with this, I think

docs/source/how-to/refresh.md Outdated Show resolved Hide resolved
docs/source/how-to/refresh.md Outdated Show resolved Hide resolved
Users do not have permission to read their own auth state by default,
but `auth_state` is where the `access_token` is stored.
We need to grant the `admin:auth_state!user` scope to both the `user` and `server` roles,
so that requests with `$JUPYTERHUB_API_TOKEN` will have permission to read the access token:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there likely to be anything in auth_state that an admin wouldn't want a user to see?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's worth mentioning this, because it is possible in theory and there are not currently more fine-grained controls. I don't believe so with the current OAuthenticators, at least, which have the userinfo and token responses. Essentially, all the information OAuthenticator puts in auth state is retrievable with the access token we are after, so if you are doing this to pass the access token, access to auth state isn't giving access to any more info than you are already meaning to give by relaying the access token itself.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a caveat to the top of this section

Co-authored-by: Simon Li <[email protected]>
@minrk minrk merged commit c027208 into jupyterhub:main Dec 3, 2024
3 checks passed
@minrk minrk deleted the how-to-refresh branch December 3, 2024 07:35
@minrk
Copy link
Member Author

minrk commented Dec 3, 2024

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants