Problem
The plugin shows one of these error messages, often after the connection has been working for a while:
Error refreshing the OAuth2 token, message: '{ "error": "invalid_grant", "error_description": "Bad Request" }'Error refreshing the OAuth2 token, message: '{ "error": "invalid_grant", "error_description": "Token has been expired or revoked." }'Cause
The plugin has lost its authorization to access your cloud account. Google has invalidated the stored access token, typically because:
- The account password was changed.
- The plugin's access was manually revoked from the account's security settings.
- The token expired and the refresh token is no longer valid (this happens after long periods of inactivity or after security-related events on the account).
Solution
Re-authorize the plugin with your Cloud account.
- Open the plugin's settings page.
- Click the revoke button for the affected Cloud account.
- Re-authorize the account by following the standard authorization flow.
If the revoke button doesn't work
In rare cases the revoke button fails to clear the broken token. To reset the authorization manually:
- In your hosting's file manager or via FTP, open the folder
wp-content/{plugin_slug}-cache. - Find the file named
youremail@address.com.access_token(with your actual email address in place of the placeholder). - Delete that file.
- Return to the plugin settings page and authorize the account again.
If the problem persists, contact our support.
Related
If the plugin frequently loses connection (not just once), the underlying cause may be unrelated to OAuth. See The plugin keeps losing connection with my cloud accounts.