Error: Bad Request with redirect uri mismatch - The error I am getting when trying to connect with a Google Drive Credential

Describe the problem/error/question

I am trying to authenticate a Google Drive credential in n8n Cloud using my own Google OAuth 2.0 client (Web application).
The Google login and consent screens complete successfully, but after consent, the OAuth callback fails inside n8n with a redirect URI mismatch error.

Some important things to note are that n8n recommends to use this URL:

Where in the error logs it is actually using:

So I swapped my redirect URL in google console to use https://advaitsingh79.app.n8n.cloud/rest/oauth2-credential/callback

Yet still after logging in and giving google drive full permission I am getting this error message:

Information on your n8n setup

  • n8n version: 2.1.2
  • Running n8n via (Docker, npm, n8n cloud, desktop app): n8n cloud
  • Operating system: Windows

This is the exact error im having its an issue in n8n I talked to a professional at google support and its all correct on their end

1 Like

How did you contact someone from google support

1 Like

I’m having the same problem. I’ve been trying to fix it for three days now, but unsuccessfully. I’m starting to lose my mind.

2 Likes

me too! Could it be an issue on Google’s side? I’ve tried literally everything but no solution. Right now I’m experimenting with alternatives like Airtable for Sheets

1 Like

Hey, I can confirm it is 100% an N8N issue, not Google. I just cancelled my account, my N8N cloud account and self-hosted it and it’s all working perfect now. I can’t have these automations not working for multiple days.

2 Likes

let us know if you know if you find out when they will fix it! Do bug fixes take a long amount of time? Thanks a lot

I have a workspace account for my bussiness so can access support

Im not sure but ive been seen this issue before through looking at the forums and ive never seen a solution on the user side unless it was a basic mistake inputting ID/Secret key or something basic. I just couldnt wait even a day i have clients who rely on these automations to function

hitting this too.
cloud host.

1 Like

Hey @mielye_mitchell … can’t understand how did you make it works.

I may understand thst Cloud version(I don’t have access at one now to test) have some OAuth issues…

But “cancel” them both and works? Or restart the workspace from Admin panel?

Hope Santa will visit you all :grinning_face:

Cheers!

1 Like

I am having the same exact issue and it happened right after I upgraded my n8n version to 2.2.0

1 Like

Is there a way we can send a bug report to the n8n team?

Try updating to version 2.1.3. Based on this, issue should be fixed.

J

1 Like

Bad news - I now can pass the initial screen error, but after connecting and providing the permission, then I get this error now.

1 Like

I am getting the exact same error after updating the version. Let us know if you find a fix

Update everyone, n8n released version 2.1.4, this fixes the issue for cloud users.

I wish you guys the best,

2 Likes

This isn’t a Google OAuth issue, it’s an n8n Cloud behavior mismatch.

In n8n Cloud, you cannot reliably use a custom Google OAuth client for Google Drive the same way you do in self-hosted. Even if the consent flow completes, n8n Cloud injects its own internal OAuth flow name and state, which changes the effective redirect URI at runtime.

That’s why you’re seeing:

/rest/oauth2-credential/callback
vs
/rest/oauth2-credential/callback?flowName=GeneralOAuthFlow

Google treats those as different redirect URIs. Adding only the base path will still fail.

What actually works (tested patterns)

Option 1 - Correct fix (recommended)
Use n8n Cloud’s built-in Google credentials, not a custom OAuth client.
n8n Cloud is already registered and compliant with Google’s OAuth policy. This avoids redirect mismatches entirely.

Option 2 - If you must use your own OAuth client
You must register ALL possible redirect variants in Google Cloud Console, including:

https://advaitsingh79.app.n8n.cloud/rest/oauth2-credential/callback
https://advaitsingh79.app.n8n.cloud/rest/oauth2-credential/callback*

Google UI doesn’t document this well, but n8n appends query params dynamically. If Google doesn’t see an exact match, it hard-fails.

Option 3 — Full control (advanced / production)
Self-host n8n and explicitly set:

  • N8N_HOST

  • WEBHOOK_URL

  • N8N_EDITOR_BASE_URL

Then register one static redirect URI. This is the only setup where custom OAuth is fully predictable.

Why this keeps confusing people

n8n Cloud abstracts OAuth for security and multi-tenant reasons. The UI suggests a static redirect URL, but internally the flow name is dynamic. That’s why the docs + logs feel contradictory.

If you want custom OAuth + zero surprises, self-hosting is the line where everything snaps into place.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.