Class JWTEncoder

java.lang.Object
io.fusionauth.jwt.JWTEncoder

public class JWTEncoder extends Object
Author:
Daniel DeGroff
  • Constructor Details

    • JWTEncoder

      public JWTEncoder()
  • Method Details

    • encode

      public String encode(JWT jwt, Signer signer)
      Encode the JWT to produce a dot separated encoded string that can be sent in an HTTP request header.
      Parameters:
      jwt - The JWT.
      signer - The signer used to add a signature to the JWT.
      Returns:
      the encoded JWT string.
    • encode

      public String encode(JWT jwt, Signer signer, java.util.function.Consumer<Header> consumer)
      Encode the JWT to produce a dot separated encoded string that can be sent in an HTTP request header.
      Parameters:
      jwt - The JWT.
      signer - The signer used to add a signature to the JWT.
      consumer - A header consumer to optionally add header values to the encoded JWT. May be null.
      Returns:
      the encoded JWT string.