N8N locally and google

You need to use https and a qualified domain name for your local instance to use OAuth with it.

In easy words: You cannot use http://localhost:5678 but would need something like https://yourdomain.tld

Usually this is done by buying a domain name and setting up cloudflare tunnels or ngrok or any other reverse proxy solution.

There are a lot of great guides out there for this setup. Here is just one from a community member: Securely Self-Hosting n8n with Docker & Cloudflare Tunnel (The... Arguably Less-Painful Way)