Functions -
jwt
issueJwt | Issue a JWT token based on provided header and payload. JWT will be signed (JWS) if |
validateJwt | Validity given JWT string. |
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
- header JwtHeader
-
JwtHeader object
- payload JwtPayload
-
JwtPayload object
- config JwtIssuerConfig?
-
JWT issuer config record
Validity given JWT string.
Parameters
- jwtToken string
-
JWT token that need to validate
- config JwtValidatorConfig
-
JWT validator config record
-
Return Type
(JwtPayload | JwtError) If JWT token is valied return the JWT payload. An
JwtError
if token validation fails.