Free for 4 days: connect your Google Business Profile and get every Pro feature. No payment needed.
Chamko AI
Profile optimisation

Google Business Profile OAuth invalid_grant: Refresh Token Expired, Revoked, or Rejected

This article focuses on OAuth refresh token lifecycle in a Google Business Profile integration.

By Chamko Research Team Updated 5 min read

Quick answer

This article focuses on OAuth refresh token lifecycle in a Google Business Profile integration.

Overview

This article focuses on OAuth refresh token lifecycle in a Google Business Profile integration.

Overview

An invalid_grant response during token refresh means the authorization server cannot accept the grant presented by the application. The cause can include a revoked or expired refresh token, a token issued to a different client, a changed account state, a malformed token exchange, or an authorization-code flow that no longer matches the original request. For a Business Profile integration, this often appears as a previously connected customer suddenly needing to reconnect. Do not repeatedly retry the same rejected refresh token. Diagnose the token's origin and lifecycle, then request consent again when necessary.

Separate access tokens from refresh tokens

An access token is short-lived and is sent with API requests. A refresh token can be used to obtain a new access token without asking the user to sign in each time, subject to Google's rules and the user's authorization state. An expired access token is normal and should usually be refreshed. A rejected refresh token is different: retrying it with the same parameters will not reliably restore access. Keep token types separate in storage and code. Do not accidentally send an access token to the token endpoint as though it were a refresh token, or overwrite a stored refresh token with an empty value from a later response.

Check which client issued the token

OAuth tokens are associated with the client and authorization context under which they were issued. If the application changes its client ID, moves to a new Cloud project, or rotates configuration incorrectly, a stored refresh token may no longer be usable in the way the new deployment expects. Confirm the token belongs to the current OAuth client. Store a token record with the client configuration version, user connection, creation time, and last successful refresh time, without logging the token value itself. If a migration changes the OAuth client, plan a reconnection process rather than assuming every existing token will transfer automatically.

Review revocation and account changes

A user may revoke the application's access from their Google Account settings. Access can also be affected by changes to the user's account or organisation policies. If the token worked for months and then fails without a code deployment, check whether the user disconnected the application, changed account status, or is subject to an administrator policy. Do not infer that the business profile itself was deleted. Ask the user to reconnect using the intended Google Account and grant the required consent again. Explain what access the application needs and why; do not pressure the user to grant permissions unrelated to the product.

Handle token storage carefully

Store refresh tokens in a secure server-side secret store or encrypted database with access restricted to the application components that need them. Never expose them to browser JavaScript, client-side logs, analytics events, or support screenshots. When a refresh fails, mark the connection as needing reauthorization and stop repeatedly scheduling jobs against it. Keep the token status separate from the profile's business status. A UI message such as “Google connection needs attention” is more accurate than “Business listing failed.” Make sure the system can recover when the user reconnects and that the new token is saved atomically.

Design a reconnection flow

The reconnection flow should explain that the previous authorization is no longer usable, open the normal Google OAuth consent process, and associate the new authorization with the correct customer and account. Validate the returned state parameter and the expected account context before saving credentials. If the user signs in with a different Google Account, make that change visible instead of silently attaching the wrong account. After a successful token exchange, perform a small authorised read to confirm that the connection works. Then resume queued work carefully and avoid replaying every previously failed write without checking whether it already succeeded.

Troubleshooting sequence

Capture the error type and timestamp without recording the token. Confirm the application is using the correct OAuth client and token endpoint parameters. Check whether a refresh token was actually stored and whether the code accidentally replaced it with a blank value. Review deployment changes and user revocation signals. If the token is rejected, stop automatic retries and ask the user to reauthorize through the supported flow. After reconnection, test one low-risk request, update the connection status, and process pending jobs with deduplication safeguards.

Example scenario

A retail chain's dashboard stops synchronising one client's locations. Other clients continue working, and the affected connection returns invalid_grant on refresh. The team verifies that the deployed client configuration has not changed and that the customer revoked the application's access during a security review. The dashboard marks only that connection as requiring reauthorization. The customer reconnects using the intended account; the team confirms access with a read request and resumes the queue. The business profile itself did not need a new listing, address edit, or verification request.

Common mistakes

Do not loop on a rejected refresh token, ask customers to share tokens by email, or automatically switch to another Google Account. Do not treat every invalid_grant as a Google service outage. Avoid deleting all connection data before recording which customer needs to reconnect, because that can make recovery confusing. Do not restart failed update jobs blindly after reauthorization; first determine which operations completed before the connection broke. Preserve a clear audit trail of the reconnection event without storing sensitive credentials in that trail.

Conclusion and next steps

An invalid_grant response is an authorization lifecycle problem until evidence shows otherwise. Check the client configuration and token storage, stop retries against a rejected refresh token, and guide the user through a fresh supported consent flow when required. Keep token status separate from profile status, protect credentials, and resume queued work safely after reconnection.

Operational acceptance criteria

A robust integration should distinguish a routine access-token refresh from a rejected refresh token, display a clear reconnect action, and stop repeated background failures. Test a valid refresh, a revoked token, a missing token, a different client configuration, and a user who reconnects with another account. Confirm that reconnecting updates the correct tenant and does not duplicate earlier writes. These tests protect customers from confusing account-connection failures with changes to their actual business listings.

Customer-facing status and recovery

Show the connection's last successful refresh time and a simple next action, such as reconnecting the Google Account. Avoid exposing the raw OAuth error as the only message because it does not tell a business owner what to do. Preserve pending job details while the connection is paused, and notify the owner only when action is needed. After reauthorization, confirm the expected account and process the pending queue gradually instead of creating a sudden burst of requests.

Keep reading