Migrate from the global issuer to a tenant issuer
Tenant issuers are not available yet: a host can be mapped to a directory, but no token is minted for it. This guide says what is intended and what to do now so the later switch costs nothing.
State in this release: tenant issuers are not available
Every token the service issues carries one issuer, the platform's, and one set of signing keys. AUTH_SERVICE_TENANT_HOSTS has three modes. off (the default) never looks at the request host. shadow resolves the host against the recorded tenant domains and counts what on would refuse, and still serves every request as the platform. on answers 421 Misdirected Request for a host that is neither one of the platform's own names nor an active tenant domain; the health probes are exempt. A forwarded host is believed only from a trusted proxy, and only as a single value.
What is built is the mapping from a host to a directory. A tenant host serves public metadata and refuses everything that would issue a token: there is no per-tenant key, no per-tenant discovery and no tenant mint yet, so there is still nothing to migrate to. Do not create tenant domains in production. Every place that decides the issuer reads one per-request context, and the platform's discovery documents and key set are unchanged byte for byte, pinned by a test.
What is intended
A directory with its own host would behave as its own issuer. Where the design is not decided, this page says so.
- The iss of its tokens is that host, not the platform's.
- Its tokens are signed with keys that belong to that directory and are published only in that host's key set. The platform's key set never lists tenant keys, and the reverse.
- Discovery and the key set URL answer per host.
- A client is bound to a directory, and a client with no binding keeps working only on the platform host.
- Codes, refresh tokens, introspection, revocation and userinfo are bound to the host, so a token from one issuer is not accepted at another. Back-channel logout tokens are signed with the tenant's key.
- Cookies and CSRF origin rules are per host. A directory that moves to its own host re-enrols passkeys, because a passkey is bound to the host name.
- Not decided: how long platform-issuer tokens stay valid for a directory that moves, and whether any client carries over automatically. Plan for a window in which both issuers appear.
Do now: nothing here depends on the feature
These steps are safe today.
- Do not hard-code the issuer in logic. Read it from the discovery document, compare it as an exact string and treat it as opaque.
- Verify against an explicit allow-list of issuers, not a pattern. The SDK multi-issuer verifiers check iss against your list before any key is fetched, keep a key cache per issuer, take the algorithm from the key and refresh once on an unknown kid. A single-issuer deployment is one entry. Never add an issuer because a token claims it.
- Pin the audience per API. It is the registered resource URI and does not change with the issuer.
- Key caches and account records by issuer. Store people by the pair of issuer and sub: the same sub from two issuers is two different people.
- Honour caching. Discovery and key set answers carry Cache-Control public, max-age=300.
- Verify back-channel logout tokens with the same verifier, which checks the issuer allow-list first.
- Keep redirect URIs exact, and plan to register a tenant host's callbacks as new entries, not wildcards.
At cutover, to be confirmed when it ships
Add the tenant issuer to your allow-list before any token with that issuer can reach you, and keep the platform issuer listed until its tokens and refresh tokens are gone. Register the tenant host's redirect URIs on the directory's clients and move your applications to its discovery URL. Then test that a token from each issuer verifies, that a token presented with the other issuer's kid fails, and that a token for another audience fails.
Rollback
The platform issuer stays valid on the platform host, so rolling an application back means pointing it at the platform issuer again and keeping both in the allow-list. Passkeys enrolled for a tenant host do not carry back to the platform host.