Skip to content

Filter claims by granted scopes for the IdToken case#3304

Open
coheigea wants to merge 1 commit into
mainfrom
coheigea/userinfo
Open

Filter claims by granted scopes for the IdToken case#3304
coheigea wants to merge 1 commit into
mainfrom
coheigea/userinfo

Conversation

@coheigea

Copy link
Copy Markdown
Contributor

No description provided.

userInfo.setAudience(idToken.getAudience());
}
if (idToken.getPreferredUserName() != null) {
if (scopes.contains(OidcUtils.PROFILE_SCOPE) && idToken.getPreferredUserName() != null) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit, we could probably move scopes.contains(OidcUtils.PROFILE_SCOPE) to own if:

if (scopes.contains(OidcUtils.PROFILE_SCOPE)) {
  if ( idToken.getPreferredUserName() != null) {
     userInfo.setPreferredUserName(idToken.getPreferredUserName());
  }
  ...
}

if (OidcUtils.PHONE_CLAIMS.contains(claimName)) {
return scopes.contains(OidcUtils.PHONE_SCOPE);
}
return true;

@reta reta Jul 10, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Shouldn't it be false by default? Or we really don't care what those claims are

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants