Hello,
I’m having a persistent issue with my self-hosted n8n where Google OAuth2 authentication fails. Instead of redirecting to Google (302 Found
), the request to /rest/oauth2-credential/auth
returns a 200 OK
with the n8n editor’s HTML, resulting in a blank popup.
My Environment:
- n8n: Self-hosted via Docker.
- Proxy: Apache2 reverse proxy with SSL termination.
- URL:
https://n8n.domain.com
Things I have definitively ruled out:
- Reverse Proxy: The issue persists even when bypassing Apache and connecting directly to the n8n container’s exposed port. The correct
RequestHeader set X-Forwarded-Proto "https"
directive is in place. - n8n Version: The issue occurs on multiple versions, including
1.100.1
,1.90.2
, and:stable
. - Data Corruption: The issue occurs even when starting n8n with a completely fresh, empty volume (both for the
.n8n
directory and a clean SQLite database). - Browser Cache: The issue persists in Incognito/Private browser windows.
- Google Credential: The issue persists even after deleting the old OAuth Client ID and creating a brand new one from scratch.
- Google Cloud URIs: I have verified that my
Authorized JavaScript origins
andAuthorized redirect URIs
are correct.
- Origins:
https://n8n.domain.com
- Redirect URIs:
https://n8n.domain.com/rest/oauth2-credential/callback
My docker-compose.yml
for the proxied setup is:
services:
n8n:
image: n8nio/n8n:stable
container_name: n8n
restart: always
ports:
- "127.0.0.1:5678:5678"
environment:
N8N_PROTOCOL: https
N8N_HOST: n8n.domain.com
WEBHOOK_URL: https://n8n.domain.com/
volumes:
- ~/.n8n:/home/node/.n8n
I am looking for any non-standard causes, as all standard troubleshooting has failed. Any ideas would be greatly appreciated.