Automatic token refresh
Nango automatically refreshes OAuth access tokens before they expire. You don’t need to implement any refresh logic in your application. To prevent token revocation due to inactivity (some APIs revoke unused refresh tokens), Nango refreshes each access token at least once every 24 hours.What happens when refresh fails
A refresh can fail when:- The user revokes access in the external app
- The provider revokes the refresh token
- The provider has an outage
"success": true so your app can detect recovery without polling. After several consecutive days of failed refreshes, Nango stops retrying.
Detect invalid credentials
Auth webhooks
Enable Auth: token refresh webhooks under Environment Settings > Webhooks. An auth webhook withoperation: "refresh" and success: false tells your app which connection failed to refresh. Use connectionId to identify the connection and error to see what happened before deciding whether to prompt the user to reconnect.
Nango API
When Nango reaches its refresh retry limit, Get a connection can return HTTP424 with invalid_credentials. The same error can appear in Nango logs.
Provider logs
In Logs, look for a Token refreshed operation. A provider that rejects an expired or revoked refresh token may returninvalid_grant. The error code and description vary by provider.
Reconnect the user
- Monitor failures and recoveries — Enable auth webhooks so your app knows when refresh fails and when it recovers.
- Handle revoked credentials — If credentials remain invalid, show a reconnect prompt so the user can authorize again.
- Implement reauthorization — Follow Add re-authorization to let users reconnect an existing connection.
Related guides
- Setup guide - implement reconnect sessions for invalid credentials
- Webhooks from Nango - receive refresh failure and recovery notifications