n8n Google OAuth redirect_uri_mismatch Error

Workaround available n8n Cloud, self-hosted Updated October 21, 2026

Quick answer

Google rejects the connection when the redirect URI n8n sends doesn't exactly match the one in your Google Cloud OAuth client. Copy the redirect URL from the n8n credential into Google Cloud, set your public URL on self-hosted instances, and update n8n if you're on an affected version.

Most likely fix: Copy the exact redirect URL into Google Cloud.

Symptoms

Connecting Google Drive, Gmail or Sheets credentials opens a Google page with 'Error 400: redirect_uri_mismatch' (sometimes 'Error 401: invalid_client').

Why it happens

  • Redirect URI in Google Cloud doesn't match n8n's exactly
  • Self-hosted n8n generating a localhost callback URL
  • n8n Cloud bug where the displayed and sent redirect URLs differed (reported fixed in 2.1.4+)
  • Wrong client ID/secret pasted into n8n

How to fix it

Try these in order — the most common fix is first.

  1. 1. Copy the exact redirect URL into Google Cloud

    1. Open the credential in n8n and copy the OAuth Redirect URL
    2. In Google Cloud Console go to APIs & Services > Credentials > your OAuth client
    3. Paste it under Authorized redirect URIs and save
    4. Wait a few minutes and reconnect
  2. 2. Set the public URL on self-hosted n8n

    1. Set N8N_HOST, N8N_PROTOCOL=https and WEBHOOK_URL (or N8N_EDITOR_BASE_URL) to your public domain
    2. Set N8N_PROXY_HOPS=1 if behind a reverse proxy
    3. Restart, then copy the new redirect URL into Google Cloud
  3. 3. Update n8n

    1. Users reported the n8n Cloud mismatch was fixed in version 2.1.4
    2. Update to the latest version (Cloud admin dashboard or new Docker image)
    3. Recreate the credential

This guide also covers

  • n8n redirect_uri_mismatch
  • n8n google oauth error
  • n8n google drive credential error
  • n8n oauth redirect localhost

Still not working?

If n8n keeps failing, you're not alone. See every n8n problem users report or the alternatives people switch to.

Other n8n errors