-
Notifications
You must be signed in to change notification settings - Fork 55.9k
Description
Bug Description
Subject: Bug Report: OAuth Redirect URL always returns HTTP instead of HTTPS (Gmail/Google credentials)
Hi N8N Team,
I'm writing to report a critical bug that makes it impossible to use Gmail/Google OAuth credentials in a self-hosted production environment.
The Problem:
The OAuth Redirect URL shown in the Gmail and Google OAuth2 API credentials always displays HTTP (e.g., http://yourdomain.com:5678/rest/oauth2-credential/callback), even when the following environment variables are correctly configured:
- WEBHOOK_URL=https://yourdomain.com/
- N8N_PROTOCOL=https
- N8N_HOST=yourdomain.com
Environment:
- Self-hosted N8N on VPS (Ubuntu 24.04)
- Docker + Caddy reverse proxy setup (n8n-docker-caddy)
- HTTPS works correctly on the domain
- N8N accessed via https://yourdomain.com
Why this is a critical issue:
Google Cloud Console requires HTTPS redirect URIs for sensitive scopes (e.g., Gmail) in production mode. Since N8N generates an HTTP URL regardless of configuration, it is impossible to:
- Add the redirect URI to Google Cloud Console (it gets rejected)
- Move the Google OAuth app to production mode
- Use Gmail integration with more than 100 test users
This makes the Gmail integration completely unusable for any serious production use case.
Steps to reproduce:
- Set up self-hosted N8N with HTTPS via reverse proxy
- Set WEBHOOK_URL=https://yourdomain.com in environment variables
- Create a Gmail or Google OAuth2 API credential
- Observe that OAuth Redirect URL still shows http:// with port 5678
Expected behavior:
The OAuth Redirect URL should reflect the WEBHOOK_URL environment variable and show https://yourdomain.com/rest/oauth2-credential/callback
This issue is also reported by multiple users in the community forum and on GitHub. Please prioritize this fix as it blocks a very common and important integration.
Thank you,
N8N User
To Reproduce
Set up self-hosted N8N with HTTPS via reverse proxy
Set WEBHOOK_URL=https://yourdomain.com/ in environment variables
Create a Gmail or Google OAuth2 API credential
Observe that OAuth Redirect URL still shows http:// with port 5678
Expected behavior
The OAuth Redirect URL should use HTTPS instead of HTTP
Debug Info
N8N-ben Help > About n8n > Copy debug information
Operating System
Ubuntu 24.04
n8n Version
latest
Node.js Version
N/A
Database
PostgreSQL
Execution mode
queue
Hosting
self hosted