mirror of
https://gitee.com/log4j/pig.git
synced 2024-12-22 12:48:58 +08:00
优化
This commit is contained in:
parent
f49edd9a3d
commit
9081414939
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user