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 | error

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 | error)
  • JWT token string or an error if token validation fails

validateJwt

(string jwtToken, JwtValidatorConfig config)

returns JwtPayload | error

Validity given JWT string.

Parameters

  • jwtToken string
  • JWT token that need to validate

  • Return Type

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