Refreshed access tokens are not issued in JWT format when setUseJwtFormatForAccessTokens is set
@@ -398,6 +398,7 @@ public abstract class AbstractOAuthDataProvider implements OAuthDataProvider, Cl
at.setSubject(oldRefreshToken.getSubject());
at.setNonce(oldRefreshToken.getNonce());
at.setClientCodeVerifier(oldRefreshToken.getClientCodeVerifier());
+ at.getExtraProperties().putAll(oldRefreshToken.getExtraProperties());
if (restrictedScopes.isEmpty()) {
at.setScopes(oldRefreshToken.getScopes() != null
? new ArrayList<OAuthPermission>(oldRefreshToken.getScopes()) : null);
@@ -409,6 +410,13 @@ public abstract class AbstractOAuthDataProvider implements OAuthDataProvider, Cl
throw new OAuthServiceException("Invalid scopes");
}
}
+
+ if (isUseJwtFormatForAccessTokens()) {
+ JwtClaims claims = createJwtAccessToken(at);
+ String jose = processJwtAccessToken(claims);
+ at.setTokenKey(jose);
+ }
+
return at;
}
