n8n

How to Connect Auth0 User Login?

Add secure sign in to your n8n apps with a simple redirect and callback. Users log in through your identity provider, and their basic profile is fetched to control access. Great for teams that need to protect internal tools or forms without writing code.

The flow starts at a login webhook that stores your app keys and redirects the user to the hosted login page. After sign in, the callback webhook receives a code. A smart check confirms the code is present and shows a clear error if it is missing. The flow then swaps the code for an access token and calls the userinfo endpoint to get a verified email and profile. All values move through Set nodes, and HTTP Request nodes handle the token exchange and profile fetch.

Setup is simple. Create a Single Page Application in your identity provider, add the callback URLs, and paste the domain, client id, and client secret into the Set nodes. Expect faster onboarding and fewer access mistakes because sign in is handled in one place. Use this to guard admin panels, internal request forms, or any workflow that must run only for known users.

What are the key features?

  • Login webhook starts the sign in and passes app settings forward.
  • Respond to Webhook node redirects users to the hosted authorize page with openid email and profile scopes.
  • Set nodes store domain, client id, client secret, and server URL for reuse.
  • If node validates the presence of the authorization code and stops with a clear error when missing.
  • HTTP Request exchanges the code for an access token using the token endpoint.
  • HTTP Request fetches user profile from the userinfo endpoint with a Bearer token.
  • Callback webhook receives the code right after login for a smooth handoff.
  • Optional social login by adding a connection parameter to the authorize URL.

What are the benefits?

  • Reduce manual user checks from 30 minutes to 2 minutes per request
  • Streamline sign in setup by 70 percent using hosted login
  • Improve access accuracy by cutting wrong access attempts by 80 percent
  • Handle 10 times more login requests without extra staff
  • Connect your identity provider and n8n in one flow

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with Auth0. See the Tools Required section above for links to create accounts with these services.
  3. In your Auth0 dashboard, create a Single Page Application. Copy the Domain, Client ID, and Client Secret from the app settings.
  4. Add allowed callback URLs in Auth0. Include your n8n base URL and your callback URL, for example https://your-server/webhook/receive-token.
  5. In n8n, open the node named Set Application Details and enter your domain, client id, client secret, and set my_server to your n8n base URL.
  6. Open the node named Set Application Details1 and make sure the same values are present so the token and user info steps can read them.
  7. Optional security: Double click the HTTP Request nodes. In the Credential to connect with dropdown, click Create new credential and follow the on screen steps if you prefer to store secrets in n8n credentials.
  8. Open the Respond to Webhook node and confirm the redirect URL points to your authorize endpoint and the redirect_uri matches your receive token webhook URL.
  9. Publish or activate the workflow. Copy the public webhook URLs for /webhook/login and /webhook/receive-token if you use n8n Cloud.
  10. Test by visiting https://your-server/webhook/login. Sign in and check the execution to see the Get Userinfo output with email and profile.
  11. If you see Couldn't get authorization code, verify the callback URL in Auth0 matches exactly and that my_server in the Set node is correct including protocol.
  12. If the token step fails, check client secret, domain, and that the content type is application x www form urlencoded. Start a fresh login so the code is not reused.
  13. Optional: To direct users to a social provider, append connection=github to the authorize URL in the Respond to Webhook node.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

Auth0

Sign up

Free plan: $0 / mo, up to 25,000 MAUs

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.