Skip to content

Bug Report: OAuth Redirect URL always returns HTTP instead of HTTPS (Gmail/Google credentials) #26066

@liptakera

Description

@liptakera

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:

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:

  1. Add the redirect URI to Google Cloud Console (it gets rejected)
  2. Move the Google OAuth app to production mode
  3. 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:

  1. Set up self-hosted N8N with HTTPS via reverse proxy
  2. Set WEBHOOK_URL=https://yourdomain.com in environment variables
  3. Create a Gmail or Google OAuth2 API credential
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions