Oauth page redirecting

Issue: Google OAuth2 Credentials Not Connecting on Render (Self-Hosted)

Hi everyone :waving_hand:

I’m facing an issue when trying to connect my Google credentials to n8n.

Hosting Setup

  • I’m currently self-hosting n8n on Render.
  • The setup process itself went smoothly — n8n is running fine.

Problem

Whenever I try to connect a Google service (e.g. Calendar, Sheets, Drive, Docs), the OAuth2 credential flow doesn’t complete.

Here’s what I’ve done:

  1. Went to Google Cloud Console.
  2. Enabled the relevant Google APIs (e.g., Calendar API, Drive API).
  3. Created OAuth2 credentials (Web app).
  4. Added the redirect URI that n8n provides.
  5. Pasted the Client ID and Client Secret into the n8n credential form.
  6. Clicked Connect and selected the Google account that owns the project.

After that — the loading page just fails to complete and doesn’t redirect back to n8n.


Additional Notes:

  • I’ve tried this flow 6–7 times, and it fails every single time.
  • I’ve also tried other self-hosting setups, and the same issue persists — n8n runs, but the credentials fail to authenticate.
  • Other credentials like OpenAI don’t fail so i think its only a google issue.
  • I’ve tested across multiple Google modules (Calendar, Drive, Sheets, Docs).
  • Screenshots of the issue are attached.

Any help would be greatly appreciated.


Sorry you can not use localhost as redirect url domain.

localhost basically equals = my home.

You need something like ngrok or cloudflare tunnel to give you a public domain so it can redirect to your device.

Did you enable all the Google APIs you want to use?
Go to google cloud console and search for the APIs you want to use (calender, docs etc) and enable them.

It should work fine in localhost too.
For render hosted, make sure the redirect URI you enter in google cloud console is “(domain that render gave you)/rest/oauth2-credential/callback”