Skip to main content

JWT

Type ID: core.jwt  ·  Kind: Action  ·  Ports: 1 in, 1 out

Signs a payload into a JWT or verifies an existing token, in both cases using the HS256 algorithm and a shared secret. Optional issuer and audience claims can be included when signing or validated when verifying.

Credentials​

None

Properties​

PropertyKeyTypeRequiredDefaultPossible valuesApplies when
OperationoperationoptionsYessignsign - Sign; verify - VerifyAlways
PayloadpayloadobjectNo{}an object to signoperation = sign
TokentokenstringNo''the JWT token to verifyoperation = verify
SecretsecretstringYes''the shared secret used for HS256 signing and verificationAlways
Expires InexpiresInstringNo''optional token lifetime such as 5m or 1h (also accepts a numeric seconds value)operation = sign
IssuerissuerstringNo''optional issuer claim to include or validateAlways
AudienceaudiencestringNo''optional audience claim to include or validateAlways

Notes​

  • secret is required and must be a non-empty string, otherwise execution throws.
  • Sign: payload must be a plain object. Output: { token }.
  • Verify: token is required; an invalid token throws. Output: { valid: true, payload } (a string-decoded payload is wrapped as { value: <string> }).