@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(UserDetails userDetails) |
java.util.Optional<java.lang.String> |
generate(UserDetails userDetails,
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 UserDetails userDetails)
createKey
in interface RefreshTokenGenerator
userDetails
- The user details@NonNull public java.util.Optional<java.lang.String> generate(@NonNull UserDetails userDetails, @NonNull java.lang.String token)
generate
in interface RefreshTokenGenerator
userDetails
- 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