Skip to main content

JWT Generate Node

The JWT Generate Node is used to create JSON Web Tokens (JWT) inside a DotPortion workflow. It enables authentication and authorization flows such as:
  • User login
  • Session management
  • Secured APIs
  • Token-based access control
This node generates a signed JWT that can be returned to the client or used internally.

What the JWT Generate Node Does

The JWT Generate Node is responsible for:
  • Creating a signed JWT token
  • Embedding custom payload data
  • Applying token expiration
  • Using a secure secret for signing
It works similarly to jsonwebtoken.sign() in traditional backend systems.
Jwt Generate

Configuration Fields

Payload

The Payload defines the data embedded inside the JWT. It must be a valid JSON object. You can:
  • Write static JSON
  • Insert dynamic values using {{ }}

Example

{
  "userId": "{{user.id}}",
  "role": "{{user.role}}"
}
This data becomes part of the JWT claims.

Secret

The Secret defines which secret key is used to sign the token. Currently supported option:
  • JWT – Uses the platform-managed JWT secret
🔐 DotPortion securely manages this secret for you.
No manual key handling is required.

Expires In

The Expires In field defines how long the token remains valid. This follows standard JWT expiration formats.

Examples

ValueMeaning
10m10 minutes
1h1 hour
7d7 days

Output

The JWT Generate Node outputs the generated token. Example output:
{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
This token can be:
  • Returned using the API Response Node
  • Used in downstream logic
  • Stored in a database

Example: Generate Login Token

Configuration

Payload
{
  "userId": "{{user.id}}",
  "email": "{{user.email}}"
}
Secret
JWT
Expires In
1h