dimas-b commented on code in PR #2389:
URL: https://github.com/apache/polaris/pull/2389#discussion_r2353083901


##########
runtime/service/src/main/java/org/apache/polaris/service/auth/JWTBroker.java:
##########
@@ -156,16 +142,18 @@ public TokenResponse generateFromClientSecrets(
     if (principal.isEmpty()) {
       return new 
TokenResponse(OAuthTokenErrorResponse.Error.unauthorized_client);
     }
-    String tokenString = generateTokenString(clientId, scope, 
principal.get().getId());
+    String tokenString =
+        generateTokenString(principal.get().getName(), 
principal.get().getId(), clientId, scope);
     return new TokenResponse(
         tokenString, TokenType.ACCESS_TOKEN.getValue(), 
maxTokenGenerationInSeconds);
   }
 
-  private String generateTokenString(String clientId, String scope, Long 
principalId) {
+  private String generateTokenString(
+      String principalName, long principalId, String clientId, String scope) {
     Instant now = Instant.now();
     return JWT.create()
         .withIssuer(ISSUER_KEY)

Review Comment:
   side note: it might be worth setting `aud` to the realm ID and later 
validating it (for follow up). WDYT?



-- 
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]

Reply via email to