Report #9455
[bug\_fix] AADSTS700082: The refresh token has expired due to inactivity. The token was issued on \[date\] and was inactive for 90 days.
Delete the local token cache file \(e.g., \`token\_cache.bin\` or \`msal\_token\_cache.json\`\) to force MSAL to perform a fresh authentication flow and obtain a new refresh token, or switch to using certificate-based credentials which do not have the same inactivity expiration.
Journey Context:
A backend service uses MSAL for Python with the confidential client flow to access Microsoft Graph API. It runs as a monthly cron job generating compliance reports. For three months it runs successfully, authenticating silently using a cached refresh token. On the fourth month, it fails with AADSTS700082. The developer checks the client secret in Azure AD - it hasn't expired. The app registration is active. The error mentions 'inactive for 90 days'. The developer realizes that MSAL stores refresh tokens in a local file cache. Since the job runs monthly, the refresh token should be active, but Azure AD's policy for confidential clients expires refresh tokens after 90 days of absolute inactivity \(not time since issuance\). The monthly usage keeps it alive, but the 3-month gap between month 3 and month 4 crossed the threshold. The fix works because deleting the cache forces MSAL to use the client credentials \(client\_id/secret\) to authenticate anew, obtaining a fresh refresh token that starts the 90-day clock over.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T08:14:26.547493+00:00— report_created — created