Actions114
- AI Actions
- AI Advanced OCR
- Check Content Policy
- Detect Adult Content
- Detect Brand
- Detect Color
- Detect Email Type
- Detect Faces
- Enitity Detection
- Extract Contact Information
- Extract Customizable Information From Text
- Fuzzy Text Matcher
- Generate Image
- Generate Javascript Code
- Generate Python Code
- Language Detection
- Mood Detection
- PDF OCR
- Picture Object Recognition
- Picture Text Recognition
- Redact Sensitive Information From PDF
- Too Long To Read
- Transcribe
- Translation
- Business Actions
- Calculate Actions
- Code Actions
- Convert Actions
- Crypto Actions
- Date & Time Actions
- Generate Actions
- Image Actions
- Operator Actions
- PDF Actions
- Storage Actions
- Text Actions
- User Actions
Generate → Decode JSON Web Token
AI-generatedOverview
This node operation decodes a JSON Web Token (JWT). It can optionally verify the token's signature using a provided secret. This is useful in scenarios where you need to extract the payload data from a JWT for authentication, authorization, or data exchange purposes. For example, decoding a JWT received from a client to validate user identity or extract claims.
Use Case Examples
- Decoding a JWT to read user information embedded in the token.
- Verifying a JWT's signature to ensure it has not been tampered with before processing its payload.
Properties
| Name | Meaning |
|---|---|
| Code Variables | Allows defining multiple code variables with names and values to be used in the code editor for the selected function. |
| Token | The JWT string that needs to be decoded. |
| Verify | Boolean flag indicating whether to verify the token's signature. |
| Secret | Secret key used to verify the token's signature if verification is enabled. |
| Options | Additional options for decoding the token, provided as a string. |
Output
JSON
decodedToken- The decoded JWT payload and header information after decoding (and optionally verifying) the token.
Dependencies
- An API key credential for the CodeKit API
Troubleshooting
- If the token is invalid or malformed, the node may throw an error during decoding. Ensure the token string is correctly formatted as a JWT.
- If verification is enabled but the secret is incorrect or missing, the verification will fail and an error will be thrown. Provide the correct secret key for verification.
- Incorrect or malformed options string may cause decoding to fail. Ensure options are correctly formatted as expected by the underlying decoding library.
Links
- JWT Introduction - General information about JSON Web Tokens and their structure.
- jsonwebtoken Library - Popular Node.js library for decoding and verifying JWTs, likely used by the node internally.