feat: Add Multiple Custom Domains (MCD) support #218
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.
Description
Implements support for validating JWT tokens from multiple Auth0 tenants or custom domains in a single API deployment. This addresses the need for multi-tenant architectures, domain migrations, and regional deployments without requiring separate API instances.
Implementation
New Configuration Pattern
Introduces
auth0MCDconfiguration object that accepts three validation methods:Static array:
Config objects:
Dynamic resolver:
Changes
packages/access-token-jwt/src/jwt-verifier.ts
packages/access-token-jwt/src/token-verifier.ts
packages/access-token-jwt/src/discovery.ts
packages/access-token-jwt/src/get-key-fn.ts
Backward Compatibility
Fully backward compatible. Existing configurations work unchanged:
// Still works exactly as before
References
MCD GA requirements
MCD- express-oauth2-jwt-bearer-design-doc
Testing
Checklist