Access blocked: Authorization Error with with Google's OAuth 2.0

i have this error

You can’t sign in to this app because it doesn’t comply with Google’s OAuth 2.0 policy for keeping apps secure.

You can let the app developer know that this app doesn’t comply with one or more Google validation rules.
Learn more about this error

If you are a developer of n8n, see error details.

Error 400: invalid_request

What is strange is that it was working fine before, but now I get this error.

Another strange thing: I’m already connected to Gmail and Google Sheets, and they still work. But if I try to reconnect them, I get the same error. So for now I can continue using Gmail and Google Sheets, but if something disconnects me, I won’t be able to reconnect.

I’m running a self-hosted instance of n8n.

So why was it working before, and why is it not working now?

my fallback is n8n.domain.com/rest/oauth2-credential/callback and not https://n8n.domain.com/rest/oauth2-credential/callback

i dont undertand this

it should be opposite ?

estou com o mesmo probleama

Can you share here your n8n docker composer on coolify?

Conseguiu resolver?

Same problem here. How to solve?

services:

n8n:

image: docker.n8n.io/n8nio/n8n

environment:

  - SERVICE_FQDN_N8N_5678

  - 'N8N_EDITOR_BASE_URL=${SERVICE_FQDN_N8N}'

  - 'WEBHOOK_URL=${SERVICE_FQDN_N8N}'

  - 'N8N_HOST=${SERVICE_URL_N8N}'

  - 'GENERIC_TIMEZONE=${GENERIC_TIMEZONE:-Europe/Berlin}'

  - 'TZ=${TZ:-Europe/Berlin}'

volumes:

  - 'n8n-data:/home/node/.n8n'

healthcheck:

test:

    - CMD-SHELL

    - 'wget -qO- http://127.0.0.1:5678/'

interval: 5s

timeout: 20s

retries: 10

Hey @nusquama

Exactly !!

The callback URL is generating as http:// instead of https://, and Google rejects any OAuth redirect that isn’t HTTPS.

Try this fix:

make sure these three env vars are set in your Docker compose or however you’re running n8n

WEBHOOK_URL=https://n8n.yourdomain.com/

N8N_PROTOCOL=https

N8N_HOST=n8n.yourdomain.com

After updating, restart your n8n instance and check the callback URL shown in the credential setup, it should now read https://n8n.yourdomain.com/rest/oauth2-credential/callback. Then make sure that exact URL is listed in your Google Cloud Console under Authorized redirect URIs.

Let me know what happens :crossed_fingers: