Skip to content

Commit a10b4eb

Browse files
committed
Updated Example and Readme
1 parent 0c4c34e commit a10b4eb

2 files changed

Lines changed: 11 additions & 18 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ It provides:
4949

5050
- JWT validation with Auth0 JWKS integration
5151
- DPoP proof validation per [RFC 9449](https://datatracker.ietf.org/doc/html/rfc9449)
52-
- Multi-Custom Domain (MCD) support — static domain lists, or dynamic resolution at request time
52+
- Multiple Custom Domain (MCD) support — static domain lists, or dynamic resolution at request time
5353
- Extensible caching — pluggable `AuthCache` interface for distributed backends (Redis, Memcached)
5454
- Flexible authentication strategies
5555

auth0-springboot-api/EXAMPLES.md

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,16 @@ public class AdminController {
282282

283283
## Multiple Custom Domains (MCD)
284284

285-
For APIs that accept tokens from multiple Auth0 custom domains (e.g., multi-tenant SaaS, domain migrations).
285+
Multiple Custom Domains (MCD) support enables a single API application to accept access tokens issued by multiple domains associated with the same **Auth0 tenant**, including the canonical domain and its custom domains.
286+
287+
This is commonly required in scenarios such as:
288+
289+
1. Multi-brand applications (B2C) where each brand uses a different custom domain but they all share the same API.
290+
2. A single API serves multiple frontend applications that use different custom domains.
291+
3. A gradual migration from the canonical domain to a custom domain, where both domains need to be supported during the transition period.
292+
293+
In these cases, your API must trust and validate tokens from multiple issuers instead of a single domain.
294+
The SDK supports two approaches for configuring multiple domains, Static Domain List and Dynamic Domain Resolver.
286295

287296
### 1. Static Domain List
288297

@@ -326,22 +335,6 @@ public class McdConfig {
326335

327336
When a `DomainResolver` bean is present, it takes priority over the static `domains` list. The resolver receives a `RequestContext` with the request URL, headers, and the unverified `iss` claim from the token.
328337

329-
### 3. Domain + Domains Coexistence (Auth for Agents)
330-
331-
For Auth for Agents scenarios, `domain` and `domains` can coexist. The `domain` is used for Auth for Agents flows (token exchange, authorization), while `domains` is used for token validation:
332-
333-
```yaml
334-
auth0:
335-
domain: "primary-tenant.auth0.com" # For Auth for Agents flows
336-
audience: "https://api.example.com"
337-
domains: # For token validation
338-
- "primary-tenant.auth0.com"
339-
- "tenant2.auth0.com"
340-
- "tenant3.auth0.com"
341-
```
342-
343-
When both are present, the SDK always uses `domains` for token verification.
344-
345338
## Caching
346339

347340
The SDK caches OIDC discovery metadata and JWKS providers in a unified cache. By default, it uses a thread-safe in-memory LRU cache.

0 commit comments

Comments
 (0)