0CodeKit icon

0CodeKit

A toolbox of no-code utilities

Actions132

Generate → Decode JSON Web Token

AI-generated

Overview

This node provides a utility to decode JSON Web Tokens (JWTs). It can be used to extract the payload data from a JWT, optionally verifying its signature with a secret key. This is useful in scenarios where you need to inspect or validate tokens issued by authentication services or APIs.

Practical examples include:

  • Decoding an access token received from an OAuth2 provider to read user claims.
  • Verifying and decoding a JWT sent as part of a webhook or API request.
  • Debugging or inspecting tokens during development or integration testing.

Properties

Name Meaning
Token The JWT string to decode. This is required and should be provided as a secure string input.
Secret Optional secret key used to verify the token's signature. If omitted, decoding happens without verification.
Verify Signature Boolean flag indicating whether to verify the token's signature using the secret key. Defaults to true.

Output

The node outputs a JSON object representing the decoded JWT payload. This typically includes claims such as issuer, subject, expiration, and any custom data embedded in the token.

If the signature verification is enabled and fails, the node will throw an error instead of outputting decoded data.

No binary data output is produced by this node.

Dependencies

  • Requires an active connection to the external "0CodeKit" API service.
  • Needs an API key credential configured in n8n for authenticating requests to the 0CodeKit platform.
  • The node sends a POST request to the /generate/jsonwebtoken/decode endpoint of the 0CodeKit API with the token, secret, and verification flag.

Troubleshooting

  • Invalid token format: Ensure the JWT is correctly formatted as three base64url-encoded parts separated by dots.
  • Signature verification failed: If verification is enabled, provide the correct secret key matching the token's signing key.
  • Missing or invalid API credentials: Confirm that the API key credential is set up properly in n8n and has permissions to access the 0CodeKit service.
  • Network or API errors: Check connectivity to the 0CodeKit API endpoint and verify that the service is operational.

Links and References

Discussion