Skip to main content

JWT

Type ID: core.jwt  ·  Kind: Action  ·  Trace: CHAIN

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

  • Always uses HS256. secret is required and must be a non-empty string, otherwise execute() throws.
  • Sign: payload must resolve to a plain object (else throws). Output: { token }. expiresIn, issuer, and audience are only applied when non-empty; expiresIn accepts a finite number or a non-empty string.
  • Verify: token is required (else throws). When supplied, issuer and audience are enforced as verification options. Output: { valid: true, payload }, where a string-decoded payload is wrapped as { value: <string> }. An invalid token causes jwt.verify to throw.
  • Parameters are resolved through the resolver engine, so expressions are supported.