coheigea commented on code in PR #3304:
URL: https://github.com/apache/cxf/pull/3304#discussion_r3602673985
##########
rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/idp/UserInfoService.java:
##########
@@ -98,35 +99,40 @@ protected Object convertUserInfoToResponseEntity(UserInfo
userInfo) {
}
protected UserInfo createFromIdToken(IdToken idToken) {
+ return createFromIdToken(idToken, Collections.emptyList());
+ }
+
+ protected UserInfo createFromIdToken(IdToken idToken, List<String> scopes)
{
UserInfo userInfo = new UserInfo();
userInfo.setSubject(idToken.getSubject());
if (super.isJwsRequired()) {
userInfo.setIssuer(idToken.getIssuer());
userInfo.setAudience(idToken.getAudience());
}
- if (idToken.getPreferredUserName() != null) {
+ if (scopes.contains(OidcUtils.PROFILE_SCOPE) &&
idToken.getPreferredUserName() != null) {
Review Comment:
Good point, I'll fix this.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]