lasdf1234 commented on code in PR #10503:
URL: https://github.com/apache/gravitino/pull/10503#discussion_r2972680930
##########
server-common/src/main/java/org/apache/gravitino/server/authentication/JwksTokenValidator.java:
##########
@@ -140,7 +151,13 @@ public Principal validateToken(String token, String
serviceAudience) {
}
// Use principal mapper to extract username
- return principalMapper.map(principal);
+ Principal userPrincipal = principalMapper.map(principal);
+ List<String> groups = extractGroups(validatedClaims);
+ if (groups != null && !groups.isEmpty()) {
+ List<String> mappedGroups = groupMapper.map(groups);
+ return new UserPrincipal(userPrincipal.getName(), mappedGroups);
+ }
Review Comment:
Got it, resolved.
--
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]