Package edu.iu.crypt

Interface WebTokenBuilder

All Known Implementing Classes:
JwtBuilder, SessionJwtBuilder

public interface WebTokenBuilder
Represents JSON Web Token (JWT) claims.
See Also:
  • Method Details

    • jti

      Generates a unique token identifier.
      Returns:
      this
    • jti

      WebTokenBuilder jti(String tokenId)
      Provides a specific token identifier.
      Parameters:
      tokenId - token identifier
      Returns:
      this
    • iss

      WebTokenBuilder iss(URI issuer)
      Sets the token issuer URI.
      Parameters:
      issuer - URI
      Returns:
      this
    • aud

      WebTokenBuilder aud(URI... audience)
      Sets the token audience URIs.
      Parameters:
      audience - at least one URI
      Returns:
      this
    • sub

      WebTokenBuilder sub(String subject)
      Sets the subject of the JWT.
      Parameters:
      subject - (sub claim)
      Returns:
      this
    • iat

      Indicates that build() should set the issued at time to the current time.
      Returns:
      this
    • nbf

      WebTokenBuilder nbf(Instant notBefore)
      Sets the time before which the JWT should not be accepted.
      Parameters:
      notBefore - not before time (nbf claim)
      Returns:
      this
    • exp

      WebTokenBuilder exp(Instant expires)
      Sets the time after which the JWT should not be accepted.
      Parameters:
      expires - token expiration time (exp claim)
      Returns:
      this
    • nonce

      WebTokenBuilder nonce(String nonce)
      Sets the nonce claim.
      Parameters:
      nonce - nonce claim value
      Returns:
      this
      See Also:
    • build

      WebToken build()
      Builds a WebToken instance based on provided claim values.
      Returns:
      WebToken