File tree Expand file tree Collapse file tree
openmetadata-service/src/main/java/org/openmetadata/service/security/jwt Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -52,6 +52,8 @@ public class JWTTokenGenerator {
5252 private static final String EMAIL_CLAIM = "email" ;
5353 private static final String IS_BOT_CLAIM = "isBot" ;
5454 public static final String TOKEN_TYPE = "tokenType" ;
55+ public static final String PREFERRED_USERNAME = "preferred_username" ;
56+ public static final String USERNAME = "username" ;
5557 public static final String IMPERSONATED_USER_CLAIM = "impersonatedUser" ;
5658 private static final JWTTokenGenerator INSTANCE = new JWTTokenGenerator ();
5759 private RSAPrivateKey privateKey ;
@@ -157,6 +159,8 @@ public JWTAuthMechanism getJwtAuthMechanism(
157159 .withClaim (EMAIL_CLAIM , email )
158160 .withClaim (IS_BOT_CLAIM , isBot )
159161 .withClaim (TOKEN_TYPE , tokenType .value ())
162+ .withClaim (USERNAME , userName )
163+ .withClaim (PREFERRED_USERNAME , userName )
160164 .withIssuedAt (new Date (System .currentTimeMillis ()))
161165 .withExpiresAt (expires )
162166 .sign (algorithm );
You can’t perform that action at this time.
0 commit comments