Jira OAuth refresh token invalid_grant — What it means & how to fix it
Blog post from Nango
Integrating with Jira using OAuth 2.0 (3LO) can lead to token refresh failures, causing disruptions in scheduled syncs and issue writes, and effectively disconnecting the integration until the token lifecycle is repaired. These failures commonly occur due to issues with rotating refresh tokens, such as using outdated tokens, concurrency problems, inactivity expiration, user consent revocation, or mismatched client credentials. To address these issues, it is crucial to persist the new refresh token after each successful refresh, ensure only one refresh is in flight per connection, and use the correct Atlassian OAuth endpoints. If a terminal issue arises, re-authorization is necessary. Preventive measures include storing the most recent refresh token, implementing single-flight refresh with atomic writes, planning for inactivity expiry, and providing a clear user experience for reconnecting. Nango offers an open-source solution that manages OAuth token refreshing and rotation, helping developers focus on product features rather than maintaining the complexities of the Atlassian OAuth process.