Interface OneTimeTokenService

All Known Implementing Classes:
InMemoryOneTimeTokenService

public interface OneTimeTokenService
Interface for generating and consuming one-time tokens.
Since:
6.4
  • Method Details

    • generate

      @NonNull OneTimeToken generate(GenerateOneTimeTokenRequest request)
      Generates a one-time token based on the provided generate request.
      Parameters:
      request - the generate request containing the necessary information to generate the token
      Returns:
      the generated OneTimeToken, never null.
    • consume

      @Nullable OneTimeToken consume(OneTimeTokenAuthenticationToken authenticationToken)
      Consumes a one-time token based on the provided authentication token.
      Parameters:
      authenticationToken - the authentication token containing the one-time token value to be consumed
      Returns:
      the consumed OneTimeToken or null if the token is invalid