Discover how to secure your n8n workflows with OAuth, protect access, and improve automation safety using simple, effective setup steps.

Book a call with an Expert
Starting a new venture? Need to upgrade your web app? RapidDev builds application with your growth in mind.
The most practical and production‑safe way to “secure n8n with OAuth” is to put n8n behind an external reverse proxy (like OAuth2 Proxy, Cloudflare Access, or a provider's OAuth gateway) and force users to authenticate with OAuth before they can even reach n8n’s UI or webhooks. n8n does not currently provide built‑in OAuth login for its own UI — so the correct approach is securing access at the network/proxy layer.
n8n itself does not allow “login with Google” or “login with GitHub” built‑in. The only way to require OAuth before someone reaches the editor, REST API, or webhook endpoints is:
In production, the two most common tools are:
This method is used by real companies running n8n because it fully locks down:
This example uses Google OAuth because it’s the most widely used, but the same idea works for GitHub, Azure, Okta, etc.
The flow is simple:
version: "3.8"
services:
oauth2-proxy:
image: quay.io/oauth2-proxy/oauth2-proxy:v7.5.1
environment:
OAUTH2_PROXY_PROVIDER: "google"
OAUTH2_PROXY_CLIENT_ID: "${GOOGLE_CLIENT_ID}"
OAUTH2_PROXY_CLIENT_SECRET: "${GOOGLE_CLIENT_SECRET}"
OAUTH2_PROXY_COOKIE_SECRET: "${COOKIE_SECRET}" // any random 32-byte base64 string
OAUTH2_PROXY_EMAIL_DOMAINS: "*" // restrict by domain if needed
OAUTH2_PROXY_UPSTREAMS: "http://n8n:5678"
ports:
- "8080:4180" // expose proxy, not n8n
depends_on:
- n8n
n8n:
image: n8nio/n8n:latest
environment:
N8N_HOST: "localhost"
N8N_PORT: 5678
N8N_EDITOR_BASE_URL: "https://your-domain.com"
N8N_WEBHOOK_URL: "https://your-domain.com"
expose:
- "5678"
In this setup:
Webhooks are tricky: external services (like Stripe, GitHub, or Notion) cannot perform OAuth login.
To deal with this, you normally do one of these:
This is normal practice because webhooks rely on signatures, not login‑based auth.
In OAuth2 Proxy, you can exempt n8n’s webhook endpoints:
OAUTH2_PROXY_SKIP_AUTH_ROUTES: "^/webhook/"
Then you rely on:
This keeps the editor fully locked behind OAuth without breaking webhook workflows.
The correct and production‑ready way to secure n8n with OAuth is to put it behind a reverse proxy like OAuth2 Proxy or Cloudflare Access. This proxy forces OAuth login before anyone can reach the n8n editor, API, or any sensitive endpoints. Webhooks can be selectively exempted while remaining secure through tokens and signature validation. n8n does not offer built-in OAuth for its own login, so securing it at the proxy layer is the industry-standard approach and what real production teams use.
When it comes to serving you, we sweat the little things. That’s why our work makes a big impact.