@Singleton public class AccessRefreshTokenGenerator extends Object
Modifier and Type | Field and Description |
---|---|
protected ClaimsGenerator |
claimsGenerator |
protected ApplicationEventPublisher |
eventPublisher |
protected JwtGeneratorConfiguration |
jwtGeneratorConfiguration |
protected TokenGenerator |
tokenGenerator |
protected TokenRenderer |
tokenRenderer |
Constructor and Description |
---|
AccessRefreshTokenGenerator(JwtGeneratorConfiguration jwtGeneratorConfiguration,
TokenRenderer tokenRenderer,
TokenGenerator tokenGenerator,
ClaimsGenerator claimsGenerator,
ApplicationEventPublisher eventPublisher) |
Modifier and Type | Method and Description |
---|---|
Optional<AccessRefreshToken> |
generate(String refreshToken,
Map<String,Object> oldClaims)
Generate an
AccessRefreshToken response for the given
refresh token and claims. |
Optional<AccessRefreshToken> |
generate(UserDetails userDetails)
Generate an
AccessRefreshToken response for the given
user details. |
protected final ClaimsGenerator claimsGenerator
protected final JwtGeneratorConfiguration jwtGeneratorConfiguration
protected final TokenRenderer tokenRenderer
protected final TokenGenerator tokenGenerator
protected final ApplicationEventPublisher eventPublisher
public AccessRefreshTokenGenerator(JwtGeneratorConfiguration jwtGeneratorConfiguration, TokenRenderer tokenRenderer, TokenGenerator tokenGenerator, ClaimsGenerator claimsGenerator, ApplicationEventPublisher eventPublisher)
jwtGeneratorConfiguration
- Instance of JwtGeneratorConfiguration
tokenRenderer
- Instance of TokenRenderer
tokenGenerator
- Intance of TokenGenerator
claimsGenerator
- Claims generatoreventPublisher
- The Application event publiserpublic Optional<AccessRefreshToken> generate(UserDetails userDetails)
AccessRefreshToken
response for the given
user details.userDetails
- Authenticated user's representation.public Optional<AccessRefreshToken> generate(String refreshToken, Map<String,Object> oldClaims)
AccessRefreshToken
response for the given
refresh token and claims.refreshToken
- The refresh tokenoldClaims
- The claims to generate the access token