Interface NonceTokenIssuer


public interface NonceTokenIssuer
A service that can issue and introspect TokenAttributes instances that are meant to be used no more than once (i.e., a nonce).
Since:
2.1.0
  • Method Details

    • issue

      String issue(TokenAttributes tokenAttributes) throws TokenIssuerException
      Issue the given token as a nonce.
      Parameters:
      tokenAttributes - to issue
      Returns:
      a String representing the token.
      Throws:
      TokenIssuerException - if a problem occurs while issuing the token
    • introspect

      Optional<TokenAttributes> introspect(String tokenString)
      Introspect a token represented by the given tokenString.

      If the token does not exist, or the token has already been consumed, or the token is not of the correct type, this method returns Optional.empty(), otherwise, the token instance is returned within the Optional.

      Parameters:
      tokenString - token as a String.
      Returns:
      the token instance or empty() if the token does not exist, has already been consumed, or is not of the correct type.