Add offline_access to default OIDC scope - #538
Conversation
|
Pull requests must include at least one of the required labels: |
PR SummaryThis PR updates the default set of OAuth scopes used for OIDC device flow authentication to include the Test Suggestions
|
The OIDC access token was captured once at vm.init() and reused for the life of the process, with no expiry check or refresh on the request path. Once the provider's token lifetime elapsed (e.g. Okta's 1h), every API call failed until the user manually re-ran vm.init(), and the failure surfaced as a generic APIRequestError with no indication the token expired. Add request-path refresh: _get/_post/_ping proactively refresh via the cached refresh token (offline_access, the default scope since #538) when the token is within the 120s expiry skew; _get/_ping additionally force a refresh and retry once on a 401. A rejected OIDC token now raises a clear ValidMindAuthError telling the user to re-run vm.init(). Refresh is serialized under a lock to avoid a refresh stampede across threads.
Pull Request Description
This adds 'offline_access' to the requested scopes on the validmind library oauth flow. This enables reauth after a timeout.
What and why?
How to test
What needs special review?
Dependencies, breaking changes, and deployment notes
Release notes
offline_flagsadded to requested oauth scopes when library authenticates via oauthChecklist