Interface EmailTokenVerifier

All Known Implementing Classes:
SignedTokenEmailTokenVerifier

public interface EmailTokenVerifier
Verifies the token used by new email address verification process.
  • Method Details

    • encode

      String encode(Account.Id accountId, String emailAddress)
      Construct a token to verify an email address for a user.
      Parameters:
      accountId - the caller that wants to add an email to their account.
      emailAddress - the address to add.
      Returns:
      an unforgeable string to email to emailAddress. Presenting the string provides proof the user has the ability to read messages sent to that address. Must not be null.
    • decode

      Decode a token previously created.
      Parameters:
      tokenString - the string created by encode. Never null.
      Returns:
      a pair of account id and email address.
      Throws:
      EmailTokenVerifier.InvalidTokenException - the token is invalid, expired, malformed, etc.