JSON Web Token (JWT) Helper icon

JSON Web Token (JWT) Helper

An implementation of the Json Web Token (JWT) helper standard, offering the ability to sign and verify tokens

Overview

The main purpose of the JSON Web Token connector is to sign and verify JSON Web Tokens. It is implemented using the NodeJS jsonwebtoken library. This libraries docs page can be used for more details about the various advanced options.

Operations List

  • Sign
  • Verify

Authentication

This connector provides an authentication option that allows you to securely store any key/secret you wish to use to sign/verify the JSON Web Token.
The default key input value for a JSON Web Token sign/verify operation

By default the key input property will reference the key stored in the authentication, however you can manually override this with a value if you wish to source your key from elsewhere. Please remember that if you override this key input property, it the value will not be obfuscated in the workflow execution logs.

Example usage

Using a simple key/secret abcdef and the following JSON payload

\{
  "sub": "1234567890",
  "name": "John Doe",
  "iat": 1516239022
\}

Example JWT Sign Operation Input You can call the Sign operation and will receive the following JWT response

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.IWvkxodTX0kCUbSXguAwSxBlQ-AxTdq2xnweEdfUbgo

If you were to pass this JSON Web Token response into the Verify operation, you should receive the same payload back.

Error Handling

The Verify operation supports Manual Error Handling to take a different path if the token is valid or invalid. This could be used for example to receive an incoming Webhook payload, verify the payload and respond to the Webhook with different messages depending on the validity of the JWT. Error handling with the JWT Verify operation

Was this page helpful?