Block 1 - Webhook
- Type / Role
- n8n-nodes-base.webhook - webhook
- Config choices
- Version 1
This workflow is provided as-is. Please review and test before using in production.
Intro This workflow needs a user to authenticate by using an openid connect provider in order to call the webhook. If the user is not authenticated, it starts a login process by using an Authorizat...
n8n-nodes-base.webhook, n8n-nodes-base.code, n8n-nodes-base.httprequest, n8n-nodes-base.respondtowebhook, n8n-nodes-base.if, n8n-nodes-base.html, n8n-nodes-base.stickynote, n8n-nodes-base.set
This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by please-open.it.
Original n8n.io sourceThis workflow needs a user to authenticate by using an openid connect provider in order to call the webhook.
If the user is not authenticated, it starts a login process by using an Authorization Code with PKCE https://datatracker.ietf.org/doc/html/rfc7636, a standard way to authenticate users with openid connect.
Then, after the user logs in, the webhook is refreshed and gets the user's token from a cookie. With this token, all details about the user are requested through the userinfo endpoint on the identity provider.
Keycloak Keycloak is an open source identity and access management solution.
Feel free to get a demo realm at https://please-open.it or get your own Keycloak server up and running.
After creating a realm, go to "Realm Settings" and click on "OpenID Endpoint Configuration"
Retrieve authorization_endpoint, token_endpoint and userinfo_endpoint values. Set those variables in the "Set variables" node.
In Keycloak, create a new client (name it as you want)
Disable the client authentication, check only "standard flow" :
At the third step, put the webhook url in "valid redirect URIs", fill "Web origins" with a "+".
You're done, open the webhook and it asks you to authenticate.
The userinfo node returns this structure about the user has logged in :
[
{
"sub":"73a6543f-f420-4fa6-9811-209e903c348b",
"email_verified":true,
"preferred_username": "[email protected]",
"email": "[email protected]"
}
]
I can use those infos in my workflow for custom operations.
the "code" node returns me a cookie named "n8n-custom-auth" which is the access_token returned by the identity provider. This access_token can be used to call APIs connected to this identity provider (for example, we call userinfo API with this token).
Example : asks a user to log in with his Google account then call an API (Gmail, drive...) with his own token.
We published a blog post about this flow, how it works and how you can use it : https://blog.please-open.it/n8n-openid-client/
This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.
| Workflow | Authenticate a user in a workflow with OpenID Connect |
|---|---|
| Complexity | advanced |
| Nodes | 15 |
| Categories | Engineering |
| Author | please-open.it |
| Published | 29 Nov 2023 |
Use the JSON export at /data/workflows/1997/1997.json as the source template for this automation.
Open n8n, import the downloaded JSON, and review each node before activating the workflow.
Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.
Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.
Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.
Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.
Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.
Intro This workflow needs a user to authenticate by using an openid connect provider in order to call the webhook. If the user is not authenticated, it starts a login process by using an Authorizat...
Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.
Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Engineering use case.