Interface TokenGenerator

All Known Implementing Classes:
JwtTokenGenerator

public interface TokenGenerator
Responsible for generating token strings.
Since:
1.0
Author:
Sergio del Amo
  • 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

      Optional<String> generateToken(Map<String,Object> claims)
      Parameters:
      claims - Claims to be included in the JWT token to be generated
      Returns:
      a JSON Web Token ( JWT )