Functions - jwt

issueJwt

Issue a JWT token based on provided header and payload. JWT will be signed (JWS) if keyStore information is provided in the JwtIssuerConfig and the alg field of JwtHeader is not NONE.

validateJwt

Validity given JWT string.

issueJwt

(JwtHeader header, JwtPayload payload, JwtIssuerConfig? config)

returns string | JwtError

Issue a JWT token based on provided header and payload. JWT will be signed (JWS) if keyStore information is provided in the JwtIssuerConfig and the alg field of JwtHeader is not NONE.

Parameters

  • Return Type

    (string | JwtError)
  • JWT token string or an JwtError if token validation fails

validateJwt

(string jwtToken, JwtValidatorConfig config)

returns JwtPayload | JwtError

Validity given JWT string.

Parameters

  • jwtToken string
  • JWT token that need to validate

  • Return Type

    (JwtPayload | JwtError)
  • If JWT token is valied return the JWT payload. An JwtError if token validation fails.