I cant connect google apps with n8n with OAuth

i am trying to connect google apps ( google sheet , google docs , google drive ) to n8n self hosted on my pc ( tried both tunnel and non tunnel version)

when i tried to connect to n8n it showed me this problem

For this i searched the n8n forum and fixed it too using this response
strong text

But after when i fixed the O Auth problem and connected the google account with n8n it is showing error 504 , connection timeout for both n8n tunnel and normal , by reading this post

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:
1 Like

n8n version - 1.67.1
Database - default as of n8n self hosted
Running n8n via npm
OS - Windows 10 64 bit

Hey @3xOGsavage,

This normally means your Google app is not correctly configured, I would avoid using the tunnel and use a reverse proxy or a different tunnel service like ngrok or cloudflared.

You may need to add your email to the allowed testers for your google app.

add email to allowed testers in the google cloud console right? did that but still no results

this is what i got after adding the emails to allowed testers list. i got the options to allow permission to my google account but then it keeps on loading until it times out


hello @3xOGsavage

You’ve said the n8n is self-hosted. But the URL on the last screen contains the n8n.cloud part. What is your callback URL?

its something like
https://xxxxxxxxxxxxxxxxxxxxxxxxx.hooks.n8n.cloud/rest/oauth2-credential/callback

do i need to need to post the actual url here? i didnt post it for safety concerns

Well… you can try a tricky method and set the webhook url as localhost:5678. I don’t know if that works with Google, but it works with Azure apps.

Another option is to use a service account. It doesn’t need to expose your n8n instance.

Can’t say about tunnel services

is there any other option to use webhooks by not launching the n8n tunnel version?

Yes, by exposing your n8n instance directly to the internet. As you are hosting your instance locally, it is better to use docker, as it will be run in the isolated container and not directly on your PC. Plus You’ll need to configure your router to forward a port you will use for webhook (443 or other). Plus you’ll need to get a Let’s Encrypt certificate (free) for the n8n to work via SSL.

Another options are as Jon suggested

2 Likes