Laptop Clock Three Days Slow Caused Google API Auth Failures, Not Bad Credentials
A developer spent time investigating a Google Search Console authentication failure after receiving an invalid_grant error, initially suspecting a compromised or rotated service account key. The real cause turned out to be the laptop running the scheduled script having a system clock three days behind the actual date. Because Google's OAuth tokens include issued-at (iat) and expiry (exp) timestamps derived from the machine clock, the signed JWT appeared to Google as already expired upon arrival. A simple curl command against Google's servers revealed the three-day discrepancy between local and real time. The incident highlights that invalid_grant errors from token endpoints can indicate a clock synchronization problem rather than a credential issue, and reading the full error_description field is key to diagnosing the actual fault.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in