This commit is contained in:
jumuning 2022-05-31 17:43:01 +08:00
parent f49edd9a3d
commit 9081414939

View File

@ -84,15 +84,14 @@ public class CustomeOAuth2AccessTokenGenerator implements OAuth2TokenGenerator<O
OAuth2TokenClaimsSet accessTokenClaimsSet = claimsBuilder.build();
// 组装key PIG:client:username:uuid
// 组装key token:client:username:uuid
String key = String.format("%s::%s::%s", SecurityContextHolder.getContext().getAuthentication().getPrincipal(),
context.getPrincipal().getName(), UUID.randomUUID());
OAuth2AccessToken accessToken = new CustomeOAuth2AccessTokenGenerator.OAuth2AccessTokenClaims(
return new CustomeOAuth2AccessTokenGenerator.OAuth2AccessTokenClaims(
OAuth2AccessToken.TokenType.BEARER, key, accessTokenClaimsSet.getIssuedAt(),
accessTokenClaimsSet.getExpiresAt(), context.getAuthorizedScopes(), accessTokenClaimsSet.getClaims());
return accessToken;
}
/**