feat: add Multiple Custom Domain Support#71
Merged
kishore7snehil merged 15 commits intomainfrom Apr 9, 2026
Merged
Conversation
nandan-bhat
requested changes
Mar 3, 2026
…tion and add cache_max_entries guidance
…domain # Conflicts: # .github/workflows/test.yml # poetry.lock
nandan-bhat
previously approved these changes
Apr 9, 2026
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.
📋 Changes
This PR implements Multiple Custom Domain (MCD) support for auth0-api-python, enabling APIs to accept tokens from multiple Auth0 custom domains with static lists, dynamic resolvers, and hybrid mode for zero-downtime domain migrations.
✨ Features
domainsparameter (static list or callable resolver) onApiClientOptionsdomainanddomainstogether for migration scenarios —domaindrives client-initiated flows (token exchange, connection tokens),domainsdrives token verificationDomainsResolvercallable with request context (DomainsResolverContext)CacheAdapterABC allows custom backends (Redis, Memcached, etc.) with a defaultInMemoryCacheimplementation🔧 API Changes
ApiClientOptionswith MCD parameters:domains,cache_ttl_seconds,cache_max_entries,cache_adapterrequest_urlandrequest_headersparameters toverify_access_token()andverify_request()for resolver contextDomainsResolverContext(TypedDict),DomainsResolver(type alias)ConfigurationError(invalid SDK config, status 500),DomainsResolverError(resolver failure, status 500)CacheAdapter(ABC),InMemoryCache(default LRU cache with TTL)📖 Documentation
README.mdwith MCD feature callout and new section 7 (Multi-Custom Domain Support)docs/MultipleCustomDomain.md— configuration modes, resolver patterns, error handling, migration guidedocs/Caching.md— default behavior, custom adapters (Redis example), tuning recommendations🧪 Testing
Manual Integration Testing
Requires an Auth0 tenant with multiple custom domains configured and a machine-to-machine application with client credentials grant enabled.
Expected: All three domains succeed. Each token's
issmatches its issuing domain.Contributor Checklist