Validate Auth0 JWT tokens using JWKS or signing cert
> Note: This template requires a self-hosted community edition of n8n. Does not work on cloud. Try It Out This n8n template shows how to validate API requ...
🔌 Nodes & Integrations Used (1)
📖 Implementation & Setup Guide
> Note: This template requires a self-hosted community edition of n8n. Does not work on cloud.
Try It Out ### This n8n template shows how to validate API requests with Auth0 Authorization tokens.
Auth0 doesn't work with the standard JWT auth option because: 1) Auth0 tokens use the RS256 algorithm. 2) RS256 JWT credentials in n8n require the user to use private and public keys and not secret phrase. 3) Auth0 does not give you access to your Auth0 instance private keys.
The solution is to handle JWT validation after the webhook is received using the code node.
How it works * There are 2 approaches to validate Auth0 tokens: using your application's JWKS file or using your signing cert. * Both solutions uses the code node to access nodeJS libraries to verify the token. * **JWKS**: the `JWK-RSA` library is used to validate the application's JWKS URI hosted on Auth0 * **Signing Cert**: the application's signing cert is imported into the workflow and used to verify token. * In both cases, when the token is found to be invalid, an error is thrown. However, as we can use error outputs for the code node, the error does not stop the workflow and instead is redirected to a 401 unauthorized webhook response. * When token is validated, the webhook response is forwarded on the success branch and the token decoded payload is attached.
How to use * Follow the instructions as stated in each scenario's sticky notes. * Modify the Auth0 details with that of your application and Auth0 instance.
Requirements * Self-hosted community edition of n8n * Ability to install npm packages * Auth0 application and some way to get either the JWK url or signing cert.
⚡ How to import this workflow into n8n:
- Click the Direct Download JSON button above to save
Validate Auth0 JWT tokens using JWKS or signing cert.json. - Log in to your n8n Cloud or self-hosted n8n instance.
- In your workflow canvas, click the menu in top-right and select Import from File (or paste the JSON directly).
- Configure your credentials (e.g. API keys, database URLs) in the corresponding node settings.
- Click Execute Workflow to test and switch to Active!
Related General Automation Workflows
View All in General Automation →Generate Application Copy
Production-ready n8n automation template for Generate Application Copy built by AhiXLight. Seamlessly connects Execute Workflow Trigger, OpenAI with 4 configured nodes.
2-way sync Google Contacts and Notion
Sync your Google Contacts with your Notion database. You can filter contacts by label or sync all contacts. All contact information is kept in sync between G...
2D Image to 3D Model Automation
Production-ready n8n automation template for 2D Image to 3D Model Automation built by AhiXLight. Seamlessly connects HTTP Request, Google Sheets, Google Drive with 17 configured nodes.
2 way sync assignments completion between Canvas LMS and Notion
Syncs assignments and completion states to and fro between Canvas LMS and a Notion database. Automatically triggers every 2 hours during the schoolday by def...