decode

This block is part of the json web token group and was last modified in core v13.0.8.

decode v13.0.8

Decodes the given json web token and returns the payload. Unverified JWTs should be treated with caution and viewed the same as other user input

In pins 1 + flow
  • flow
    flow
  • token required
    value

    the token to be decoded

Out pins 4 + flow
  • flow
    flow
  • success
    condition
  • error
    value
  • verified
    condition

    to verify the token please use jwt verify

  • payload
    object

Decodes the JWT payload WITHOUT verifying the signature; verified is always false (use jwt verify for that). Only an empty token fails, with error MISSING_TOKEN and success=false : a malformed token (fewer than 2 segments, bad base64, or non-JSON payload) still reports success=true with payload=nil. Example: token="abc" -> success=true, payload=nil.

jwt

A typical wiring for decode: a function trigger starts the flow; value feeds the token pin; the flow out pin feeds debug.

Studio canvas example for the decode block: typical wiring for decode.

Version history

Introduced in v13.0.8.


Back to json web token Return to the main group to view all sub-groups Back to json web token Return to the group to view all blocks within this group