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

Suggest possible config fix when correct scopes aren't requested #721

Merged
merged 2 commits into from
Mar 23, 2024

Conversation

yuvipanda
Copy link
Collaborator

If the hub config doesn't contain appropriate scopes to request from the provider, the token we retrieve may not have the key we are using as username_claim. This is the most common reason that username_claim is not present in the token. Add a simple debugging hint here to make lives of hub admins easier.

yuvipanda and others added 2 commits January 22, 2024 15:09
If the hub config doesn't contain appropriate scopes to request
from the provider, the token we retrieve may not have the key we
are using as `username_claim`. This is the *most common* reason that
`username_claim` is not present in the token. Add a simple debugging
hint here to make lives of hub admins easier.
Copy link
Member

@minrk minrk left a comment

Choose a reason for hiding this comment

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

Nice! If you think it's useful to reference the config field rather than just the concept, go for it. Otherwise, go ahead and merge.

@@ -770,7 +770,9 @@ def user_info_to_username(self, user_info):
"""
username = user_info.get(self.username_claim, None)
if not username:
message = (f"No {self.username_claim} found in {user_info}",)
message = (
f"No {self.username_claim} found in {user_info}. Maybe the hub needs to be configured to request more scopes?",
Copy link
Member

Choose a reason for hiding this comment

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

Do you want to even suggest the config name {self.__class__.__name__}.scopes?

@yuvipanda yuvipanda merged commit 97b470b into jupyterhub:main Mar 23, 2024
11 checks passed
@yuvipanda
Copy link
Collaborator Author

I think it's ok to just mention the concept, rather than the specific config.

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