Google credentials Redirect URLs reset on desktop

Describe the question

Google Drive Account and Tasks Account credentials keep changing OAuth Redirect URLs so I have to manually update console.cloud.google.com with them every now and then.

Is this intentional?

Any way to set up Tasks and Drive credentials once and for all (or maybe at least for a couple months)?

Thanks.

Information on your n8n setup

  • n8n version: 0.182.0
  • Database you’re using (default: SQLite): no idea
  • Running n8n with the execution process [own(default), main]: no idea
  • Running n8n via desktop app

Hey @lippiece,

Welcome to the community :tada:

The desktop app uses a tunnel url which can change if something goes wrong like the application crashes or there is a network issue, it is not ideal to rely on them for a production system.

A more permanent solution would be to use your own domain and configure the webhook_url environment option. Another option would be to use something like n8n cloud where the network routing and domain side of things are already taken care of.

1 Like

Thanks for the to-the-point answer.

I have no experience in self-hosting. Would you mind sharing an advice? Maybe I could use something like Github Pages? I really wish there’s something free and simple as in IFTTT/Zapier. The reason I’m not using them is their rigidity and a not so good UI.

I also don’t mind javascripting, but tasks like syncing data with Drive and Tasks, in my opinion, shouldn’t require much tinkering.

The tinkering is more down to the desktop app being great for getting started but that tunnel option is something we don’t tend to recommend for live environments as it has the issues you are seeing.

We have some documentation on self hosting but I think if there is maybe a limited budget this guide from @MutedJam on using Oracles free tier is very good: Setting up a free n8n server on Oracle Cloud – Thomas Martens

Another option could be to try something like nip.io which can be very handy if you don’t need to access it from the outside world. You can set the webhook url to the nip.io address and it would be good to go there is an example on how to do something similar with Desktop and ngrok here: N8n Desktop custom Webhook url ngrok - #4 by Jon

Once you have one of these sorted it will be plain sailing and you shouldn’t run into any other issues.

2 Likes

Splendid. Thank you very much.

2 Likes

Excuse me, can you explain a bit further on nip.io please?

Do I understand correctly that the idea is to set up a constant WEBHOOK_TUNNEL_URL so that the OAuth Redirect URLs wouldn’t change? To do so, I should add “nip.io” to a URL, but what URL is it?

UPD: current URL n8n using is 127.0.0.1, so it should be 127.0.0.1.nip.io, is this correct?

1 Like

Hey @lippiece,

Yeah that can work, Although if you are happy to use 127.0.0.1 as long as google lets you input it as the URL you could use that instead and just update WEBHOOK_TUNNEL_URL to match that.

What I like with nip.io is it uses whatever IP you put first for the connection so it works like a proper url, So 127.0.0.1.nip.io would try and load 127.0.0.1 and if you were to use say 192.168.1.30.nip.io it would try and use 192.168.1.30, It is pretty clever.

2 Likes

Hello again, @Jon.

If you don’t mind helping a bit more, I’m encountering this when using WEBHOOK_TUNNEL_URL = ‘127.0.0.1.nip.io’ and without “nip.io”:

Hey @lippiece,

That looks like Google might be forcing TLS for Domains, What about just setting the tunnel to 127.0.0.1 that might be a lot easier.

I did try it, same result.

I would have thought just 127.0.0.1 would work as long as you make the request from the machine you are running n8n on.

Yes, I am using the same machine. I even tried to open 127.0.0.1:5679 in the browser and then open the “connect” link from the “Credentials” tab there.

What do you have the redirect uri set to in Google?

https://127.0.0.1.nip.io/rest/oauth2-credential/callback. Tried to change protocol to http (since when I use this address in a browser with https it doesn’t work), but no avail.

UPD: tried the same change without “nip.io” too.

I suspect http://localhost:5678/rest/oauth2-credential/callback would work if you set you set the webhook url to localhost.

I will test it tomorrow to confirm

I suspect you have a typo (5678 instead of 5679), but I tried them both:

Console
image
n8n:


image

Result:

I may have missed something since I’m not that experienced.

Thank you for trying to help!

Hey @Jon, what’s up? I would really like my tasks synced sometime.

Hey @lippiece,

Your webhook tunnel would need to be http://localhost:5679 so that it includes the protocol and the port.

1 Like

It works! You rock!

1 Like