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. Copy the exact redirect URL into Google Cloud
- Open the credential in n8n and copy the OAuth Redirect URL
- In Google Cloud Console go to APIs & Services > Credentials > your OAuth client
- Paste it under Authorized redirect URIs and save
- Wait a few minutes and reconnect
2. Set the public URL on self-hosted n8n
- Set N8N_HOST, N8N_PROTOCOL=https and WEBHOOK_URL (or N8N_EDITOR_BASE_URL) to your public domain
- Set N8N_PROXY_HOPS=1 if behind a reverse proxy
- Restart, then copy the new redirect URL into Google Cloud
3. Update n8n
- Users reported the n8n Cloud mismatch was fixed in version 2.1.4
- Update to the latest version (Cloud admin dashboard or new Docker image)
- 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
- n8n Webhook Not Registered (404 Error)
- n8n Webhook URL Shows localhost
- n8n Out of Memory (JavaScript Heap Out of Memory)
- n8n Connection Lost Error
- n8n Executions Stuck in Queued / Starting Soon
- n8n Schedule Trigger Running at the Wrong Time
- n8n 'Cannot Read Properties of Undefined' Error
- n8n Workflows Broken After 2.0 Update
- n8n Cloud Workspace Offline (503 Error)