Generate JWT Token
if you own SaaS, you can authenticate your users from your app to the dashboard without asking them to login
This feature is available in our paid editions. Contact us at sales@activepieces.com, and we'll be delighted to assist you!
You can also book a call here.
Step 1: Obtain Signing Key
You can generate a signing key by going to Platform Settings -> Signing Keys -> Generate Signing Key.
This will generate a public and private key pair. The public key will be used by Activepieces to verify the signature of the JWT tokens you send. The private key will be used by you to sign the JWT tokens.
Note: Please store your private key in a safe place, as it will not be stored in activepieces.
Step 2: Generate a JWT
The signing key will be used to generate JWT tokens for the currently logged-in user on your website, which will then be sent to Activepieces Iframe as a query parameter to authenticate the user.
To generate these tokens, you will need to add code in your backend to generate the token using the RS256 algorithm, so the JWT header would look like this:
The signed tokens must include these claims in the payload:
You can use any JWT library to generate the token. Here is an example using the jsonwebtoken library in NodeJs:
You can also use this tool to generate a quick example: https://dinochiesa.github.io/jwt/.
Once you have generated the token, Please check embedding docs to know how to embed the token in the iframe.