Google OAuth Error 400: invalid_request when using n8n on Fly.io

I’m running n8n (workflow automation tool) on Fly.io, and it works fine. Now I’m trying to connect Google services like Gmail or Google Sheets using OAuth2.

I created a Google Cloud OAuth 2.0 Client ID, and I added the client_id and client_secret in n8n credentials. But when I try to authenticate, I get this error from Google:

In the error URL, I see:

redirect_uri=https://flyn8n-thrumming-feather-2258.fly.dev/rest/oauth2-credential/callback

In my Google Cloud Console, I added this exact redirect URI:

https://flyn8n-thrumming-feather-2258.fly.dev/rest/oauth2-credential/callback

I also set up the OAuth consent screen in testing mode and added my Gmail as a test user.

But the error is still there.

What I already did:

  • Checked that the redirect URI matches 100%App is in Testing mode, and my account is listed as test user

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