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

[CILogonOAuthenticator] Add profile to default scope, fix detail following recent refactoring #575

Merged
merged 2 commits into from
Mar 14, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions oauthenticator/cilogon.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ class CILogonLoginHandler(OAuthLoginHandler):

def authorize_redirect(self, *args, **kwargs):
"""Add idp, skin to redirect params"""
token_params = kwargs.setdefault('token_params', {})
extra_params = kwargs.setdefault('extra_params', {})
if self.authenticator.shown_idps:
# selected_idp must be a string where idps are separated by commas, with no space between, otherwise it will get escaped
# example: https://accounts.google.com/o/oauth2/auth,https://github.com/login/oauth/authorize
idps = ",".join(self.authenticator.shown_idps)
token_params["selected_idp"] = idps
extra_params["selected_idp"] = idps
if self.authenticator.skin:
token_params["skin"] = self.authenticator.skin
extra_params["skin"] = self.authenticator.skin

return super().authorize_redirect(*args, **kwargs)

Expand Down Expand Up @@ -91,7 +91,7 @@ def _username_claim_default(self):

scope = List(
Unicode(),
default_value=['openid', 'email', 'org.cilogon.userinfo'],
default_value=['openid', 'email', 'org.cilogon.userinfo', 'profile'],
config=True,
help="""The OAuth scopes to request.

Expand Down Expand Up @@ -273,7 +273,7 @@ def user_info_to_username(self, user_info):
user_info_keys = sorted(user_info.keys())
if len(claimlist) < 2:
self.log.error(
f"Username claim {user_info_keys} not found in response: {self.username_claim}"
f"Username claim {claimlist} not found in response: {user_info_keys}"
consideRatio marked this conversation as resolved.
Show resolved Hide resolved
)
else:
self.log.error(
Expand Down