Skip to content

Conversation

@subhankarmaiti
Copy link
Contributor

Adds automatic retry mechanism with exponential backoff for credential renewal to improve reliability in unstable network conditions. This addresses issue #1374 where refresh token rotation can fail due to transient network errors.

Changes

  • Added maxRetries option to Auth0Options interface
  • Updated iOS native bridge to pass maxRetries to CredentialsManager initialization
  • Updated Android bridge to accept parameter (ignored due to SDK limitation)
  • Updated documentation with configuration examples

Platform Support

  • iOS only: ✅ Full support via Auth0.swift v2.16.2+

Usage

const auth0 = new Auth0({
  domain: 'YOUR_DOMAIN',
  clientId: 'YOUR_CLIENT_ID',
  maxRetries: 2, // Retry up to 2 times on transient errors (iOS only)
});

With React Hooks:

<Auth0Provider domain="..." clientId="..." maxRetries={2}>
  <App />
</Auth0Provider>

Retry Behavior

Automatically retries on:

  • Network errors (timeouts, DNS failures)
  • Rate limiting (HTTP 429)
  • Server errors (HTTP 5xx)

Does NOT retry on:

  • Invalid/expired/revoked refresh tokens
  • Client errors (HTTP 4xx except 429)

@subhankarmaiti subhankarmaiti requested a review from a team as a code owner January 12, 2026 05:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants