Actions132
- AI Actions
- Extract Text From Document
- Check Content Policy
- Detect Adult Content
- Detect Brand
- Detect Color
- Detect Email Type
- Detect Faces
- Extract Entities
- Extract Contact Information
- Extract Customizable Information From Text
- Fuzzy Text Matcher
- Generate Image
- Generate JavaScript Code
- Generate Python Code
- Detect Language
- Detect Mood
- Extract Text From PDF
- Recognize Objects in Image
- Extract Text From Image
- Redact Sensitive Information From PDF
- Remove Background Image
- Summarize Text
- Transcribe
- Translate Text
- Image Actions
- Business Actions
- Convert Actions
- Generate Actions
- Crypto Actions
- Operator Actions
- Storage Actions
- Scheduler Actions
- Text Actions
- Chart Actions
- Code Actions
- Calculate Actions
- Date and Time Actions
- PDF Actions
- Compress PDF File
- Count PDF Pages
- Create Empty PDF
- Decrypt PDF
- Convert DOCX to PDF
- Draw Image on PDF
- Draw Text on PDF
- Encrypt PDF
- Convert HTML to PDF
- Convert Markdown to PDF
- Manage PDF Metadata
- Merge PDF Files
- Add PDF Pages
- Remove PDF Pages
- Resize PDF Pages
- Rotate PDF Pages
- Convert PDF to Base64
- Convert PDF to Image
- Split PDF File
- Add Image Watermark to PDF
- Add Text Watermark to PDF
- Shortened URL Actions
Generate → Encode JSON Web Token
AI-generatedOverview
This node provides a utility to generate JSON Web Tokens (JWTs) by encoding a given JSON payload with a secret key. It supports specifying the signing algorithm and token expiration time. This is useful in scenarios where you need to create JWTs for authentication, authorization, or secure data exchange between services.
Practical examples include:
- Generating access tokens for API authentication.
- Creating signed tokens that carry user identity or session information.
- Encoding claims securely to be verified later by another service.
Properties
| Name | Meaning |
|---|---|
| Payload | The JSON string representing the data to encode inside the JWT. Example: {"sub": "1234567890", "name": "John Doe"} |
| Secret | The secret key used to sign the token. This should be kept confidential. |
| Algorithm | The cryptographic algorithm used for signing. Options: HS256, HS384, HS512 |
| Expires In | Optional expiration time for the token, e.g., "1h" (1 hour), "7d" (7 days), "30m" (30 minutes). If empty, token does not expire. |
Output
The node outputs a JSON object containing the encoded JWT as a string. The output field typically looks like:
{
"token": "<encoded JWT string>"
}
There is no binary output; the result is purely textual.
Dependencies
- Requires an active connection to the external 0CodeKit API service at
https://prod.0codekit.com. - Needs an API key credential configured in n8n to authenticate requests to this service.
- No local cryptographic libraries are used; all encoding is done via the external API.
Troubleshooting
- Invalid Payload Format: If the payload is not valid JSON, the API may return an error. Ensure the payload string is properly formatted JSON.
- Incorrect Secret or Algorithm: Using an unsupported algorithm or incorrect secret might cause token generation failure.
- Expired Token Misconfiguration: Providing an invalid format for the expiration time (e.g., "one hour" instead of "1h") can lead to errors.
- API Authentication Errors: Missing or invalid API credentials will prevent the node from working.
- Network Issues: Connectivity problems to the external API endpoint will cause execution failures.
To resolve these issues:
- Validate JSON payload before input.
- Use one of the supported algorithms exactly as listed.
- Follow the expiration time format examples.
- Verify API key configuration in n8n credentials.
- Check network connectivity and proxy settings if applicable.
Links and References
- JSON Web Tokens (JWT) Introduction
- JWT RFC 7519 Specification
- 0CodeKit API Documentation (requires login/access)