How can I generate a JWT token that expires on a webhook?

How can I generate a JWT token that expires on a webhook?

“Authorization”: “Bearer TOKEN”

The webhook node does not support checking for an expiration. However, you can build this yourself with a function node. You create the JWT with the expiration that you need and when the webhook receives that JWT, the function node will decode the token and check the expiration.

Do you have an algorithm/function example for generate token JWT?

You can use something like bellow to create the token in the function node. However, you will need a bit of setup to use the library within a function node.

1 Like