Acccess /Refresh Token Google OAuth2 not valid

Hey,
In my workflows I use the predefined Google Drive OAuth2 API and also generic OAUTH2 API for functionalities with drive and slides. I set up a Client according to the documentation in GCP and pushed it to “in production” to receive a refresh token. Unfortunately I never receive this refresh token. I have read that this token is only issued once per scope, but creating a new GCP Client did not solve the problem. Does anyone have a solution for this?

Describe the problem/error/question

What is the error message (if any)?

Bad request - please check your parameters

invalid_token

Information on your n8n setup

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

PROBLEM:-

Bad request - please check your parameters
invalid_token

SOLUTION:-

EDIT YOUR QAUTH CLIENT:-

  • GO TO credentials—→QAuth 2.0 Client IDs
  • copy your Client ID and Client secret
  • in n8n, open your google QAuth2 or generic QAuth credentials.

ADD THIS TO THE “AUTH URL” IN N8N:-

  • example https://accounts.google.com/o/oauth2/v2/auth?access_type=offline&prompt=consent

RECONNECT YOUR CREDENTIALS:-

  • Delete the old n8n Google OAuth credentials.
  • Recreate them fresh with the modified Auth URL.
  • Click Connect / Sign in with Google again.
  • Approve the scopes → you’ll now get a refresh token

VERIFY INSIDE N8N:-

  • Open the credential after saving → click “View” → you’ll see a new refresh_token in JSON.
  • Now you’re safe — even after the access token expires, n8n will automatically refresh it.

HOPE IT WILL GIVE YOU A BEST IDIA !!!

Thank you very much. I tried to set this up completely new but still getting the same error after the access_token expires. Also, I can’t see the JSON view of my connection with the refresh_token data. Where can I find this? This also applies for Auth URL - can’t change this in predefined credentials.

I am using n8n cloud.

For a GET Request to:

https://www.googleapis.com/oauth2/v1/tokeninfo

I get:
“scope”: “https://www.googleapis.com/auth/presentations”,

“expires_in”: 3553,

“access_type”: “offline”

1 Like

PROBLEM:

Even though you enabled “offline” access, Google isn’t sending the refresh_token — so when the access token expires, your workflow fails.

THIS HAPPEN BECAUSE:

  1. Google only sends the refresh token once per user per scope,
  2. n8n Cloud hides credential JSON (for security),
  3. The predefined Google credentials in n8n don’t allow changing the Auth URL or token endpoint.

SIMPLE FIX:

OPTION 1 –REAUTHORIZE WITH “FRCE NEW CONSENT”

  1. Go to Credentials → Your Google OAuth2 Credential
  2. Click EditReconnect
  3. When the Google consent screen appears, click:
  • “allow”
  • make sure to tick “see and dowload your data” if it ask

important—open this link manually before reconnecting

https://myaccount.google.com/permissions

→ Find your n8n app
→ Click “Remove Access”
→ Then reconnect n8n again.

Hi @Jan5

You’re trying to set up OAuth2 credentials for Google Drive and Slides in n8n, but you are not receiving a refresh token, which is causing “Bad request” and “invalid_token” errors.
You have correctly configured your client in Google Cloud Platform and set it to “in production,” but even creating a new client did not solve the issue. You are now looking for a way to successfully obtain the refresh token.

Yes! Anything I can do additionally?