Skip to content

Light version: pages open quickly, without the 3D graphics. You are seeing the light version because the 3D graphics would be slow on this device. The content is the same.

Turn on 3D

Preparing the graphics. This can take a moment on the first visit.

Henry Lõiv

Web design & development

Quick Answer

Why does my Google OAuth connection stop working after 7 days?

Development 2 min read

A Google OAuth connection can fail after a week when its app is External and still in Testing. Refresh tokens expire after seven days in this setup, except when only basic identity scopes are requested. GA4 and Search Console access go beyond that exception. 1

Check the OAuth app behind the connection

Open the Google Cloud project that owns the OAuth client used by your MCP server. Check its audience and publishing status. The seven-day rule has an exception when the app requests only basic identity scopes such as openid, email and profile; GA4 or Search Console data access goes beyond that exception. 1

A one-hour access-token lifetime is a separate issue. Short-lived access tokens are expected; the refresh token lets the client obtain replacements. Inspect the returned expires_in value instead of assuming the two tokens expire together. 25

Choose the appropriate app status

For a development test, signing in again may be sufficient. For ongoing use, review whether the app is ready to move to Production. Publishing and verification are separate states: publishing alone does not make an app Google-verified. 3

Check the requested scopes, audience and verification requirements first. Personal-use apps can qualify for an exception; public apps using sensitive or restricted scopes have additional requirements. After the appropriate configuration change, reconnect through the tool’s normal authorization flow. 45

If the error is invalid_grant

Do not treat that message as proof of the seven-day rule. It can also indicate an invalidated token or another authorization problem. Check when the failure occurs, confirm the OAuth client and inspect the error details. If the failure happens immediately, investigate those details before changing the app’s publishing status. 5

Related reading

Sources

  1. Google: Using OAuth 2.0 to Access Google APIs — refresh token expiration
  2. Google Cloud: Token types — user access tokens
  3. Google: OAuth app state overview
  4. Google: Sensitive scope verification — exceptions
  5. Google: Using OAuth 2.0 for Web Server Applications

Fact checked:

Hi!

I really love the sea, yachts, sunsets and starry skies.

Through this little 3D world, I can share a small part of myself with you.

Thank you for opening this bottle and reading my letter.

Henry

Let’s talk about your project

Tell me about your project

Tell me what you’d like to build or improve. You don’t need a finished brief — we’ll work out the scope and next steps together.

01 How can I help?
02 How many pages do you need?
03 Which extras do you need? Choose all that apply
04 When does it need to be ready?
05 Project details
06 Your contact details

Enquiry received

Thank you!

Your enquiry has been received. I usually reply by email within 2 working days.