feat: add Multi-Resource Refresh Token (MRRT) support#1258
Merged
subhankarmaiti merged 35 commits intomasterfrom Dec 1, 2025
Merged
feat: add Multi-Resource Refresh Token (MRRT) support#1258subhankarmaiti merged 35 commits intomasterfrom
subhankarmaiti merged 35 commits intomasterfrom
Conversation
…0Client and WebCredentialsManager
…into SDK-6263_mrrt_support
This reverts commit 20ea213.
…oP key management
…n across platforms
…into feat/dpop-support
…te auth0 dependency to 3.10.0
…ate URL format in NativeBridge
…dance in FAQ and examples
…into feat/dpop-support
…tive-auth0 into SDK-6263_mrrt_support
…into SDK-6263_mrrt_support
… and documentation
…into SDK-6263_mrrt_support
…into SDK-6263_mrrt_support
…into SDK-6263_mrrt_support
…into SDK-6263_mrrt_support
…t-native-auth0 into SDK-6263_mrrt_support
…credentials manager to accept authAPI
…dential management
…mples and prerequisites
pmathew92
reviewed
Dec 1, 2025
pmathew92
reviewed
Dec 1, 2025
pmathew92
reviewed
Dec 1, 2025
There was a problem hiding this comment.
Pull request overview
This PR adds comprehensive Multi-Resource Refresh Token (MRRT) support across all platforms (iOS, Android, and Web), enabling applications to obtain access tokens for multiple APIs using a single refresh token.
Key Changes:
- Introduces two new public APIs:
getApiCredentials()andclearApiCredentials() - Adds the
ApiCredentialstype to represent API-specific credentials - Implements MRRT functionality on iOS, Android, and Web platforms with proper error handling and caching
Reviewed changes
Copilot reviewed 32 out of 33 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/types/common.ts |
Adds ApiCredentials type definition with access token, token type, expiration, and scope |
src/types/parameters.ts |
Extends RefreshTokenParameters with optional audience field for MRRT support |
src/types/platform-specific.ts |
Adds web-specific options useMrrt and useRefreshTokensFallback |
src/specs/NativeA0Auth0.ts |
Adds TurboModule specs for getApiCredentials and clearApiCredentials methods |
src/core/models/ApiCredentials.ts |
Implements ApiCredentials class with isExpired() helper method |
src/core/models/CredentialsManagerError.ts |
Adds comprehensive error code mappings for MRRT operations and extensive JSDoc documentation |
src/core/interfaces/ICredentialsManager.ts |
Extends interface with MRRT methods and detailed documentation |
src/core/services/AuthenticationOrchestrator.ts |
Adds audience parameter to refresh token requests |
src/platforms/web/adapters/WebCredentialsManager.ts |
Implements MRRT for web using @auth0/auth0-spa-js |
src/platforms/web/adapters/WebAuth0Client.ts |
Configures web client with useMrrt option and auto-enables refresh tokens |
src/platforms/native/bridge/INativeBridge.ts |
Adds native bridge interface methods for MRRT |
src/platforms/native/bridge/NativeBridgeManager.ts |
Implements native bridge methods for MRRT operations |
src/platforms/native/adapters/NativeCredentialsManager.ts |
Implements MRRT for native platforms with proper error handling |
ios/NativeBridge.swift |
Adds iOS implementation using Auth0.swift SDK's API credentials methods |
ios/A0Auth0.mm |
Exports native methods to React Native bridge |
android/src/main/java/com/auth0/react/A0Auth0Module.kt |
Implements MRRT for Android with proper parameter conversion and threading |
android/src/main/java/com/auth0/react/ApiCredentialsParser.kt |
Parses Android SDK's APICredentials to React Native format |
android/build.gradle |
Upgrades Auth0 Android SDK to v3.11.0 for MRRT support |
src/hooks/Auth0Provider.tsx |
Adds MRRT methods to React context with proper error handling |
src/hooks/Auth0Context.ts |
Exports MRRT methods in context interface with comprehensive JSDoc |
example/src/screens/hooks/CredentialsScreen.tsx |
Adds example UI for testing MRRT functionality |
example/src/screens/class-based/ClassProfile.tsx |
Updates class-based example to demonstrate MRRT usage |
EXAMPLES.md |
Adds comprehensive MRRT documentation with usage examples for hooks and class-based APIs |
FAQ.md |
Adds trailing commas for code consistency |
| Tests | Adds comprehensive test coverage for MRRT operations across all platforms |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
pmathew92
approved these changes
Dec 1, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds support for Multi-Resource Refresh Token (MRRT), enabling applications to obtain access tokens for multiple APIs using a single refresh token.
New Public APIs
getApiCredentialsRetrieves access tokens for a specific API audience.
clearApiCredentialsClears cached credentials for a specific audience.
ApiCredentialsTypePlatform Support
Usage
Web Configuration
On the web platform, you must enable MRRT support explicitly in the
Auth0Provider:Prerequisites
offline_accessscope requested during login