singhpk234 commented on code in PR #2389:
URL: https://github.com/apache/polaris/pull/2389#discussion_r2286065706


##########
runtime/service/src/main/java/org/apache/polaris/service/auth/JWTBroker.java:
##########
@@ -157,16 +143,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)
-        .withSubject(String.valueOf(principalId))
+        .withSubject(principalName)

Review Comment:
   > But other Authenticator implementations could require the principal name 
to be available
   
   i would like this understand this use case more, is it more from audit 
purpose ? or are we saying some Token Brokers would prefer look-up by name as 
names would be like `email-id` for them which is considered to unique ?
   



-- 
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: issues-unsubscr...@polaris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to