ADR-048: OIDC-Only Identity — One Trusted Issuer, SAML and LDAP Brokered Upstream
Status: Accepted (2026-09-26); amended by ADR-049 (2026-09-30), effective 2026-10-12: Amendment 1; Amendment 2 (2026-10-13, #2902)
Issue: #512
Relates to: ADR-019 (service identity; its provider list corrected here), ADR-023 (IdP portability; corrected here), ADR-043 (A3 gains a 503 row), ADR-044 (the IdP mapper owns role and program mapping), ADR-046 (the per-row issuer trigger restated), #515 (the claim contract), #514 (introspection), #2335 (the per-row issuer), #2342 (the reopen issue); design: the epic &118 plan
Context
#512 was filed as a spike on terminating SAML 2.0 inside canopy. Jurisdictions authenticate workers against SAML and LDAP sources today: the Georgia incumbent signs workers in through Okta SAML and an eDirectory LDAP directory (Gateway partner catalog, its Okta / LDAP rows).
Two facts decide the question.
-
Every worker write is an RFC 8693 exchange. Since #1443 a worker-attributed write mints a per-target bearer through
TokenExchanger(crates/canopy-auth/src/token_exchanger.rs), and without an exchanger it failsexchanger_not_configured; there is no service-token fallback (IdP Integration › the off-ramp). -
Service identity is
client_credentials(ADR-019): every service mints its own bearer from the issuer’s token endpoint.
Both are OAuth 2.0 grants. A SAML service provider in canopy would still need an OAuth 2.0 authorization server for both. It would add a second authentication protocol and remove none. ADR-019 already anticipated this: "bare AD/SAML-only deployers must run their own federator".
Before #515, three things were wrong with the identity surface:
-
The claim layout was hard-coded to Keycloak (
realm_access.roles). -
Each
[[idp]]entry named its own issuer, while the exchangers validated subjects against the boot issuer only. An entry on a second issuer signed in and then failed every worker write. -
ADR-019 and ADR-023 listed Authentik, Dex, Zitadel, Kanidm and ForgeRock as working backends. None of them was verified.
Decision
1. An OIDC relying party and an OAuth 2.0 resource server only
canopy has no SAML service provider and no LDAP bind. canopy-web signs workers in with the OIDC authorization-code flow and PKCE. Every service validates bearer access tokens as an OAuth 2.0 resource server. SAML, LDAP and AD identity sources federate into an OIDC broker, and canopy trusts the broker.
provider = "saml" is refused by name when [identity] is parsed. The
executable pin is unknown_provider_type_rejects in
crates/canopy-auth/src/identity_config.rs.
2. One trusted issuer
canopy trusts exactly one issuer, canopy-identity. It covers sign-in, refresh, both exchangers, every service’s receivers and every service token’s self-validation.
-
Where it is configured. The issuer URL is deployment configuration: the
oidc_issuer/oidc_internal_urlpair every canopy-api service reads (crates/canopy-common/src/settings.rs), and the applicant portal reads asCANOPY_PORTALOIDC_ISSUER/OIDC_INTERNAL_URL(services/canopy-portal/src/config.rs). canopy-web’s sign-in uses the same pair as its exchanger. -
Discovery is bound to it.
canopy_auth::discovery::fetch_trusted_issuerrefuses a discovery document whoseissueris not exactly the configured one, whichever URL served it and whether it came from the cache. It also refuses a document whosegrant_types_supporteddoes not listurn:ietf:params:oauth:grant-type:token-exchange. Every canopy-api service, canopy-web included, therefore refuses to boot on either (crates/canopy-api/src/bootstrap.rs). The applicant portal treats either like an unreachable issuer: it leaves its applicant routes unmounted, or exits for a restart whenCANOPY_PORTAL__REQUIRE_DEPSistrue. The grant check is necessary, not sufficient: only exchanging through both hops proves the topology (decision 5). -
Chooser entries, not issuers. An
[[idp]]entry inidp.tomlis a sign-in chooser entry. It never names an issuer. It selects an upstream at the trusted issuer throughauthorize_params, such as Keycloak’skc_idp_hint. A brokered SAML or LDAP source appears on the sign-in page as one such entry.
3. The claim contract, declared per jurisdiction
[identity] in rulesets/<jurisdiction>/idp.toml declares the issuer’s
contract (canopy_auth::IdentityConfig,
crates/canopy-auth/src/identity_config.rs). It holds the sign-in client_id
and audience, the scopes, a provider preset, and [identity.claims]:
-
roles: one or more RFC 6901 pointers, each with a shape (arrayorobject_keys); their values are unioned; -
programs: the ADR-044 program claim; -
service_prefix: the service marker’s wire prefix; -
algorithms: the signing-algorithm allow-list.
A broker product is configuration, never code. The details are in
IdP Integration › the [identity table].
Presets. provider is one of two values:
-
keycloaksupplies the whole Keycloak layout: roles at/realm_access/roles, programs at/primary_programs, theservice:prefix, RS256. -
oidc-genericsupplies only the prefix and RS256, so the jurisdiction must declarerolesandprograms.
No vendor preset ships until that vendor is verified end to end: its claim
contract checked with cargo xtask identity verify --issuer <url> --jurisdiction
<slug>, and both exchange hops exercised against it (decision 5). A preset
asserts that a layout works. An unverified preset would repeat the ADR-019 and
ADR-023 overclaim in code.
Vocabulary. Projection keeps only the roles in canopy_auth::ROLE_VOCABULARY
and values carrying the service prefix. An upstream group canopy does not know
never reaches authorization or an audit payload.
4. What the broker owes canopy, which canopy cannot check
canopy sees only the broker’s tokens. These obligations are the deployment’s, recorded here because no canopy test can catch their breach:
-
Role and program mapping. The broker maps upstream attributes and groups onto canopy’s role names and program slugs. ADR-044’s rule, "grant the programs in the IdP claim mapper", covers every upstream, and roles with it. canopy drops what it does not recognize. It cannot tell a wrong mapping from a right one.
-
Multi-factor authentication. canopy reads no
acroramrclaim. The broker enforces MFA for every upstream it brokers (NIST IA-2(1), NIST architecture mapping). -
substability across upstream re-links. canopy compares anOidcSubjectbyte for byte and records it in every attribution column (ADR-043 Amendment 1). A broker that issues a newsubwhen a user is re-linked to an upstream account splits that worker’s history into two actors. -
Deprovisioning within one access-token lifetime. A worker removed upstream must lose the ability to refresh at the broker. canopy honours a JWS access token until its
exp(plus the 60 s validation leeway): ADR-044’s maximum revocation delay is one access-token lifetime. An introspected token ([identity].validation = "introspect", or"auto"for any token other than a compact JWS naming akid;crates/canopy-auth/src/validator.rs) the issuer reports inactive is refused once its cached verdict is older thancache_ttl_secs, at most 300 s, except whileserve_on_outageserves a retained verdict during an outage.
5. The exchange topology and the verified broker
The topology any broker must serve is the one IdP Integration › the realm shape describes:
-
Hop 1: canopy-web exchanges a worker’s access token for a token addressed to canopy-eligibility that carries two audiences,
canopy-eligibilityandcanopy-eligibility-exchanger(twoaudienceparameters,TokenExchanger::post_exchange). -
Hop 2: canopy-eligibility exchanges that token for one program service, an audience absent from its input.
canopy’s exchanger sends no actor_token (ADR-043 A2: act is unused).
Verified: Keycloak 26.2 and later. Keycloak 26.2.0 made standard token
exchange a supported feature. Its documentation allows multiple audience
parameters and requires the subject token to name the requesting client in
aud. The devstack runs 26.5, which advertises the exchange grant, and its
live exchange tests and e2e worker writes run both hops against it (for
example hop2_exchange_survives_an_aged_subject,
services/canopy-eligibility/tests/receiver_contract_test.rs).
Recorded as incompatible with the topology, per each vendor’s current documentation (retrieved 2026-09-26):
-
Authentik issues one exchange audience: "authentik accepts only one
audiencevalue and does not support tokens for multiple providers". It cannot mint hop 1’s two-audience token. -
ZITADEL limits the output audiences to the input’s: a requested audience "may never contain an audience which was not already present in either the
subject_tokenoractor_tokencombined". Each hop requests a target its input does not carry, and canopy sends no actor token.
Any other RFC 8693 issuer takes the oidc-generic preset. It works when it
meets the claim contract and this topology. cargo xtask identity verify
--issuer <url> --jurisdiction <slug> --check-exchange checks part of that: the
contract’s projection of a service token, and one single-audience exchange
(its signature, azp, exact audience, a worker role and its lifetime). It
does not exercise hop 1’s two-audience mint or the hop-2 chained exchange, and
it reads tokens as JWS, so it cannot probe an issuer that mints only opaque
tokens. The topology is proven only by exchanging through both hops against
that issuer, as the devstack’s live exchange tests and e2e worker writes do
for Keycloak.
6. Reopen triggers
This decision is reopened (#2342) when any of these is observed:
-
A policy authority forbids a broker for worker authentication. This is observable as a written refusal recorded during jurisdiction onboarding.
-
A mandated identity source that no RFC 8693 issuer can broker. This is observable when onboarding records the source and no broker that federates it meets the claim contract (
cargo xtask identity verify --issuer <url> --jurisdiction <slug>) and serves both exchange hops. -
Cross-jurisdiction federation. Partner assertions would have to be verified by canopy itself (ADR-023 threat class B).
-
Trusting a second issuer, for any reason. That needs per-issuer exchangers, per-issuer receiver key sets and an issuer on every attribution row, which re-arms #2335 (ADR-046).
Consequences
-
A broker is a mandatory component. A jurisdiction whose identity source is SAML-only or LDAP-only runs an OIDC broker in front of it. On the devstack that is the Keycloak realm canopy already ships.
-
Onboarding is configuration. A jurisdiction declares its broker’s claim layout in
[identity]and its sign-in choices in[[idp]], checks the issuer’s contract withcargo xtask identity verify --issuer <url> --jurisdiction <slug>, and proves the exchange topology by exchanging through both hops against it (Jurisdiction onboarding). -
The supported set is what is verified. Keycloak 26.2+ through the
keycloakpreset, and, throughoidc-generic, any issuer that meets the claim contract and has been exercised through both exchange hops. -
Corrections to earlier ADRs. Each amended ADR carries a dated note:
-
ADR-019 and ADR-023’s provider lists are corrected to the above, and ADR-019’s
CANOPY_IDENTITY_ROLES_CLAIM_PATH/CANOPY_IDENTITY_SERVICE_ROLE_PREFIXrows are retired: the contract lives in[identity.claims](ADR-019 Amendment 2). -
ADR-043 A3 gains a 503
identity_unavailablerow: an identity outage is never an admission (ADR-043 Amendment 2). -
ADR-046’s per-row issuer trigger reads "more than one trusted issuer" (ADR-046 Addendum 2).
-
-
Out of scope, tracked:
private_key_jwtclient authentication (#2343),id_tokenvalidation and a sign-in nonce (#2344), and a refresh lead sized against the issuer’s token lifetime (#2345).
References
Vendor documentation, retrieved 2026-09-26:
-
Keycloak 26.2.0 release announcement (standard token exchange supported): https://www.keycloak.org/2025/04/keycloak-2620-released
-
Keycloak, Securing applications › Token exchange (multiple
audienceparameters; the requester in the subject token’saud): https://www.keycloak.org/securing-apps/token-exchange -
authentik, OAuth2 provider › Token exchange (one
audiencevalue): https://docs.goauthentik.io/add-secure-apps/providers/oauth2/token_exchange/ -
ZITADEL, Token exchange (the audience may not exceed the input tokens'): https://zitadel.com/docs/guides/integrate/token-exchange
Standards: RFC 8693 (token exchange), RFC 6901 (JSON pointer), RFC 8725 (JWT best current practice), OpenID Connect Discovery 1.0.
Amendment 1 (2026-10-12, #2883, ADR-049) — one upstream at the edge, one issuer inside
Status unchanged (still Accepted). ADR-049 restates this ADR’s one-issuer rule per layer (D1), and its plan I3g made that effective. In-document amendment, not an edit to the Decision; each decision as it holds now:
-
§1: canopy is also an issuer. canopy is an OIDC relying party at the edge, as canopy-web’s confidential client of one upstream. Inside, it is an OAuth 2.0 authorization server: canopy-identity, a module of canopy-security, issues every token a service accepts (ADR-049 D1, D2). The no-SAML, no-LDAP rule stands, and SAML, LDAP and AD sources federate into the upstream OIDC provider.
-
§2: one trusted issuer per layer.
-
At the edge, exactly one upstream OIDC provider, named by the deployment’s upstream profile
identity-upstream.yaml, which canopy-web and canopy-security both read (ADR-049 Amendment 5, C1). -
Inside, receivers trust only canopy-identity, configured per service as
IDENTITY_ISSUERandIDENTITY_INTERNAL_URL(Amendment 14, L6). -
The
oidc_issuerpair, the portal’sOIDC_*keys andfetch_trusted_issuer's token-exchange check are gone. An upstream’s discovery need not advertise token exchange (C6). -
[[idp]]chooser entries are gone with the chooser:idp.tomlholds only[roles.*](plan I3g SW11).
-
-
§3: the claim contract moves to the federation boundary.
[identity]andClaimContractare gone. The upstream profile declares where roles, programs and the username are read, under one of two profiles:kanidm, whose presets are canopy’s Kanidm provisioning convention, oroidc-generic, which states every field (Amendment 5, C2 and C8). Projection keeps only the roles inROLE_VOCABULARY(canopy_auth::roles) and drops service markers. canopy-identity’s own tokens carry one fixed claim layout (D3). -
§4: what the upstream owes. Role and program mapping and MFA stay the upstream’s, and canopy reads no
amroracr.-
substability softens. canopy mints its own subject for each upstream(iss, sub)pair (D8). An upstream that issues a newsubyields a new canopy subject, and a split history, until a security administrator re-links the pair (Amendment 8, H7). -
Deprovisioning. canopy-identity mints nothing from a session whose last upstream validation is older than 900 s, plus at most
identity_session_grace_secondswhile the upstream is unavailable, and an upstream refusal at renewal ends the session (D6). A minted token keeps working for the rest of its life, at most 300 s for a delegation (ADR-044 Amendment 2). -
Introspection is gone.
-
-
§5 retires (D1), with its Keycloak verification and its Authentik and ZITADEL findings: an upstream owes OIDC sign-in only. Kanidm is the default upstream (ADR-050), and the devstack runs no Keycloak.
-
§6: the triggers. Trigger 4 reads "a second upstream at the edge, or a second issuer at receivers" (D1). Trigger 2’s test drops its exchange condition, since an upstream owes sign-in only. Trigger 3 is ADR-049’s reopen trigger 3.
-
Consequences.
-
An upstream OIDC provider remains mandatory; the devstack’s is Kanidm.
-
Onboarding chooses an upstream profile and registers clients (ADR-049 Consequences).
cargo xtask identity verifyis gone:identity conformanceruns an upstream’s conformance lane, andidentity checkgates a canopy-identity deploy. -
The supported set is what is verified: Kanidm, through the
kanidmprofile (ADR-050 Amendment 3). -
The tracked items are built:
private_key_jwt(#2343, ADR-049 D10), and canopy-web’s id_token validation with a nonce (#2344) and refresh lead (#2345), wired by plan I3g.
-
Amendment 2 (2026-10-13, #2902, ADR-049 Amendment 26) — Keycloak and ZITADEL join the supported set
Status unchanged (still Accepted). ADR-049 Amendment 26 (plan I4) adds two vendor profiles, each with a passing conformance suite, as §3’s preset rule requires. In-document amendment; each decision as it holds now:
-
§3: four profiles. The upstream profile is
kanidm,keycloak,zitadeloroidc-generic. Each vendor preset fixes the claim source, refresh, client authentication, scopes, signing algorithm and claim pointers to canopy’s provisioning convention for that product. Azitadelfile also names its project and organisation: ZITADEL’s id_token names the project inaud, and its roles claim is an object whose keys count only for the profile’s organisation (AL1–AL3).oidc-genericstill states every field. -
§4: where MFA is enforced. MFA stays the upstream’s obligation, and canopy still reads no
amroracr. Kanidm enforces it by policy, Keycloak in its browser flow, and ZITADEL in Login V2, its trusted login client (AL4). ZITADEL’s login client’s credential is therefore a credential of the IdP. -
Consequences.
-
The supported set is what is verified: Kanidm 1.11.2 (
kanidm, ADR-050 Amendment 3), Keycloak 26.8.1 (keycloak, Amendment 5) and ZITADEL v4.19.4 with Login V2 (zitadel, Amendment 6). On ZITADEL, canopy-web’sauth_timecheck carries a step-up’smax_age, which ZITADEL ignores (#2906). -
An identity push runs the three suites (
cargo xtask identity matrix), and a release tag runs them in CI. A version bump of a supported upstream is a change with its suite. -
One upstream at a time still holds (§2, ADR-049 D1). Trigger 4 is unchanged.
-