0CodeKit icon

0CodeKit

A toolbox of no-code utilities

Actions108

Overview

This node provides a variety of no-code utility functions grouped by resource and operation categories. Specifically, for the Generate resource with the Decode JSON Web Token operation, it decodes a given JWT (JSON Web Token). It can optionally verify the token's signature using a provided secret and additional options.

This functionality is useful in scenarios where you need to extract information from JWTs within an automation workflow, such as:

  • Decoding authentication tokens to read user claims.
  • Verifying tokens received from external services.
  • Debugging or inspecting JWT contents without writing custom code.

Example use cases:

  • Extracting user roles or permissions encoded in a JWT.
  • Validating a token before proceeding with further API calls.
  • Logging decoded token data for audit purposes.

Properties

Name Meaning
Code Variables A collection of named variables defined in the code editor that can be used as inputs for code execution.
Token The JWT string that you want to decode.
Verify Boolean flag indicating whether to verify the token's signature.
Secret The secret key used to verify the token if verification is enabled.
Options Additional options for decoding or verifying the token, typically in JSON string format.

Output

The node outputs a JSON object representing the decoded JWT payload. This includes all claims and data contained within the token after decoding (and verification if enabled).

If verification fails (when enabled), an error will be thrown unless the node is set to continue on failure.

No binary data output is produced by this operation.

Dependencies

  • Requires an active connection to the underlying service powering the "0CodeKit" utilities, authenticated via an API key credential configured in n8n.
  • No direct external API keys are required specifically for JWT decoding beyond this credential.
  • The node relies on internal HTTP requests to the service endpoint corresponding to generate/jsonwebtoken/decode.

Troubleshooting

  • Invalid Token Format: If the token string is malformed or not a valid JWT, decoding will fail. Ensure the token is correctly formatted.
  • Verification Failure: When verification is enabled but the secret is incorrect or missing, the node will throw an error indicating signature verification failed.
  • Options Parsing Errors: If the options property contains invalid JSON or unsupported parameters, decoding may fail or behave unexpectedly.
  • Credential Issues: If the API key credential is missing or invalid, the node will fail to connect to the service.

To resolve errors:

  • Double-check the token string input.
  • Provide the correct secret when enabling verification.
  • Validate the options JSON syntax.
  • Confirm the API key credential is properly set up in n8n.

Links and References

Discussion