@Singleton @Requires(beans=RefreshTokenConfiguration.class) public class SignedRefreshTokenGenerator extends java.lang.Object implements RefreshTokenGenerator, RefreshTokenValidator
RefreshTokenGenerator
and RefreshTokenValidator
.
Create and verify a JWS encoded object whose payload is a UUID with a hash-based message authentication code (HMAC).Constructor and Description |
---|
SignedRefreshTokenGenerator(RefreshTokenConfiguration config) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
createKey(Authentication authentication) |
java.util.Optional<java.lang.String> |
generate(Authentication authentication,
java.lang.String token) |
java.util.Optional<java.lang.String> |
validate(java.lang.String refreshToken) |
public SignedRefreshTokenGenerator(RefreshTokenConfiguration config)
config
- Signed Refresh Token generator@NonNull public java.lang.String createKey(@NonNull Authentication authentication)
createKey
in interface RefreshTokenGenerator
authentication
- The user details@NonNull public java.util.Optional<java.lang.String> generate(@NonNull Authentication authentication, @NonNull java.lang.String token)
generate
in interface RefreshTokenGenerator
authentication
- The user detailstoken
- The internal value@NonNull public java.util.Optional<java.lang.String> validate(@NonNull java.lang.String refreshToken)
validate
in interface RefreshTokenValidator
refreshToken
- The refresh token