Notion OAuth refresh token invalid_grant — What it means & how to fix it
Blog post from Nango
Connecting to Notion's API with OAuth 2.0 can lead to issues such as refresh token failures, commonly resulting in an "invalid_grant" error that disrupts page syncs, database reads, or automated workflows. These errors occur when refresh tokens are invalid, expired, revoked, or improperly managed, often due to outdated tokens, URI mismatches, or concurrent refresh attempts. To mitigate these issues, it is crucial to consistently use the latest refresh token, ensure alignment between redirect URIs, and manage token refresh concurrency effectively. Users should verify client credentials and handle disconnections or policy revocations promptly. Additionally, employing tools like Nango, which automates OAuth token management, can simplify the process by handling token refreshes, concurrency, and error management, allowing developers to focus on product features rather than token lifecycle challenges.