Interface TokenGenerator
- All Known Implementing Classes:
JwtTokenGenerator
public interface TokenGenerator
Responsible for generating token strings.
- Since:
- 1.0
- Author:
- Sergio del Amo
-
Method Summary
Modifier and TypeMethodDescriptiongenerateToken
(Authentication authentication, @Nullable Integer expiration) generateToken
(Map<String, Object> claims)
-
Method Details
-
generateToken
Optional<String> generateToken(Authentication authentication, @Nullable @Nullable Integer expiration) - Parameters:
authentication
- Authenticated user's representation.expiration
- The amount of time in seconds until the token expires- Returns:
- An optional JWT string
-
generateToken
- Parameters:
claims
- Claims to be included in the JWT token to be generated- Returns:
- a JSON Web Token ( JWT )
-