Open
Conversation
Contributor
Author
There was a problem hiding this comment.
Pull request overview
This PR adds Multi-Custom Domain (MCD) support to the Auth0 Java SDK, enabling token validation against multiple issuer domains. It also introduces OIDC Discovery, a unified caching layer, and simplifies the API surface by embedding headers into HttpRequestInfo.
Changes:
- Multi-Custom Domain support with three modes: single domain (backward-compatible), static domains list, and dynamic resolver (
DomainResolver/Auth0DomainResolver) - OIDC Discovery integration in
JWTValidatorto fetch.well-known/openid-configurationper issuer, with unifiedAuthCache(defaultInMemoryAuthCacheLRU + TTL) for both discovery metadata and JWKS providers - Simplified API:
AuthClient.verifyRequest()and authentication strategies now take onlyHttpRequestInfo(which embeds headers), removing the separateheadersparameter
Reviewed changes
Copilot reviewed 42 out of 42 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
auth0-api-java/.../AuthClient.java |
Simplified verifyRequest to accept only HttpRequestInfo |
auth0-api-java/.../AuthenticationOrchestrator.java |
Updated process signature to match new API |
auth0-api-java/.../AbstractAuthentication.java |
Removed headers param from authenticate, validateBearerToken, validateDpopTokenAndProof |
auth0-api-java/.../AllowedDPoPAuthentication.java |
Updated to use requestInfo.getHeaders() |
auth0-api-java/.../DisabledDPoPAuthentication.java |
Updated authenticate; contains commented-out code |
auth0-api-java/.../RequiredDPoPAuthentication.java |
Updated authenticate; contains commented-out code and wrong Javadoc |
auth0-api-java/.../DomainResolver.java |
New core functional interface for dynamic domain resolution |
auth0-api-java/.../models/AuthOptions.java |
Added domains, domainsResolver, cache settings; updated build validation |
auth0-api-java/.../models/HttpRequestInfo.java |
Added headers field with normalization; replaced context; new single-arg constructor |
auth0-api-java/.../models/OidcMetadata.java |
New model for OIDC discovery metadata |
auth0-api-java/.../models/RequestContext.java |
New model for domain resolver context |
auth0-api-java/.../cache/AuthCache.java |
New cache abstraction interface |
auth0-api-java/.../cache/InMemoryAuthCache.java |
New thread-safe LRU+TTL cache implementation |
auth0-api-java/.../validators/JWTValidator.java |
Major rework: OIDC discovery, MCD resolution, dynamic JwkProvider caching |
auth0-api-java/.../validators/OidcDiscoveryFetcher.java |
New OIDC discovery fetcher with caching |
auth0-api-java/.../validators/ClaimValidator.java |
Minor doc/comment cleanup |
auth0-api-java/.../examples/Auth0ApiExample.java |
Removed |
auth0-springboot-api/.../Auth0AutoConfiguration.java |
MCD wiring: resolver bean bridging, domains list, cache config |
auth0-springboot-api/.../Auth0Properties.java |
Added domains, cacheMaxEntries, cacheTtlSeconds properties |
auth0-springboot-api/.../Auth0AuthenticationFilter.java |
Updated to pass headers into HttpRequestInfo and use new verifyRequest |
auth0-springboot-api/.../Auth0DomainResolver.java |
New Spring Boot functional interface for dynamic domain resolution |
auth0-springboot-api/.../Auth0RequestContext.java |
New Spring Boot request context model |
auth0-springboot-api-playground/.../SecurityConfig.java |
Formatting changes |
auth0-springboot-api-playground/.../ProfileController.java |
Added MCD demo endpoint |
auth0-springboot-api-playground/.../McdDomainResolverExample.java |
New MCD configuration example |
| Test files (multiple) | Updated to match new API signatures, added MCD and cache tests |
Comments suppressed due to low confidence (1)
auth0-api-java/src/main/java/com/auth0/validators/JWTValidator.java:162
- The
catch (Exception e)block on line 160 unconditionally wraps all exceptions — includingVerifyAccessTokenExceptionthrown earlier in this method (e.g., "Token issuer is not in the allowed list", "Symmetric algorithms are not supported", "Discovery metadata issuer does not match token issuer") — into a new genericVerifyAccessTokenException("signature verification failed", e). This masks the specific error messages introduced for MCD validation. Consider re-throwingBaseAuthExceptioninstances directly before the generic wrap, similar to howwrapAsValidationExceptionworks elsewhere in this class.
} catch (Exception e) {
throw new VerifyAccessTokenException("signature verification failed", e);
}
auth0-api-java/src/main/java/com/auth0/RequiredDPoPAuthentication.java
Outdated
Show resolved
Hide resolved
auth0-api-java/src/main/java/com/auth0/DisabledDPoPAuthentication.java
Outdated
Show resolved
Hide resolved
auth0-api-java/src/main/java/com/auth0/RequiredDPoPAuthentication.java
Outdated
Show resolved
Hide resolved
kailash-b
previously approved these changes
Mar 19, 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
Multi-Custom Domain (MCD) support — tokens can now be validated against multiple issuer domains, enabling multi-tenant. Three configuration modes are supported:
a. Single domain (auth0.domain) — existing behavior, preserved for backward compatibility
b. Static domains list (auth0.domains) — YAML-configured list of allowed issuers
c. Dynamic resolver (Auth0DomainResolver bean) — resolve allowed issuers at request time based on headers, URL, or unverified iss claim