Authsome refreshes OAuth2 access tokens automatically. When you ask for a token (viaDocumentation Index
Fetch the complete documentation index at: https://authsome.mbajaj.me/llms.txt
Use this file to discover all available pages before exploring further.
authsome get, export, run, or the library AuthLayer), authsome checks the stored expiry. If the token is within ~5 minutes of expiring, it calls the provider’s token endpoint with the stored refresh token, writes the fresh credentials back to the vault, and returns the new access token.
When refresh fails, the connection moves into one of two states.
| Symptom | Connection status |
|---|---|
| Network blip, retried later | expired |
| Refresh token rejected by provider | invalid |
Common failure modes
refresh token has been revoked
- You revoked the OAuth app’s authorization at the provider.
- The provider rotated refresh tokens and your stored token is stale.
- Long inactivity expired the refresh token (some providers have a sliding window).
client authentication failed
expired_token after long downtime
Network errors during refresh
expired — it’s recoverable. Retry once your network is back:
connected.
Inspect refresh state
The CLI exposes per-provider refresh state for debugging:--verbose:
~/.authsome/logs/authsome.log and include the token endpoint URL, request body (with secrets redacted), and the full response body on failure.
API keys never refresh
API-key providers don’t have a refresh mechanism — there’s nothing to refresh. If the stored key is rejected at runtime, the provider invalidated it externally (the user rotated it, the team revoked it, etc.). Replace it:Refresh window
By default, authsome refreshes within 300 seconds of the storedexpires_at. If a token has just expired, the next access call triggers a refresh. If the access token still has more than 5 minutes left, authsome returns it as-is.
This window is the spec’s recommended default and is not currently configurable through the CLI.
What’s next
OAuth callbacks
Diagnose login flow problems before refresh becomes the issue.
Doctor
Verify the rest of the install is healthy.