Repository navigation
Replies: 3 comments 2 replies
|
Hi @michvllni, Thanks for the detailed proposal, and apologies for the delayed response. First, deduplication: #55674 proposes the same capability from the Entra managed-identity angle. I'd keep this thread as the main one (it has the design detail, the milestones, and your offer to implement) and redirect that one here. #52440 is related but genuinely different: multiple federated credentials per client, inbound. Worth keeping both in view when shaping the capability model for #43486, but it isn't the same ask. On the substance: deriving the token endpoint from the receiver's issuer metadata is IMO the right default. It's less configuration and, as you note, it binds audience to destination, which is what closes the replay concern. An explicit audience-to-endpoint binding for non-standard receivers like Entra belongs on top of that as an override, not as the primary mechanism. I can't commit to scope or sequencing unilaterally as this needs to line up with #43486. Perhaps @stianst can weigh in on this. |
|
One requirement from (#55674) should fold into the design, though: their token source is an ambient cloud identity obtained from the platform metadata service, not a Keycloak-configured provider, so the assertion source likely needs to be a pluggable abstraction rather than specifically "reference a configured Kubernetes or SPIFFE provider." Worth settling before implementation starts. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Federated client authentication (#42634) lets clients authenticate to Keycloak with tokens from a trusted Kubernetes, SPIFFE or OIDC identity provider. The opposite direction still requires a secret. When Keycloak brokers to another OIDC provider, including another Keycloak realm, it authenticates to that provider's token endpoint with
client_secret_*or a realm-signedprivate_key_jwt.We suggest closing that gap as part of the move towards identity providers as trust relationships with capabilities (#43486).
Proposal
Add a client authentication method to OIDC identity providers: federated assertion. It references an assertion source. When brokering, Keycloak obtains a token from that source for the receiver and sends it as an RFC 7523
client_assertioninstead of a secret.Assertion sources
An assertion source is a provider SPI with one job: return a short-lived token for a given audience. The federated-assertion client authentication depends only on this contract, not on where the token comes from. Two kinds of sources:
Rules for the token
The rules apply to every source, so a new source can't weaken them:
api://AzureADTokenExchange) need an explicit audience-to-endpoint binding in the server configuration, as an override of rule 2. Everything else needs no extra configuration.This follows the IETF WIMSE workload identity practices: short-lived, pod-bound tokens, one per receiver, never the Kubernetes API token, and no credential locations derived from realm input. Keycloak's receiving side already enforces the matching rule, since federated client authentication accepts only the realm issuer as the audience.
All token requests from a broker go through
AbstractOAuth2IdentityProvider#authenticateTokenRequest, so code exchange, refresh, introspection and the brokering token-exchange paths are covered in one place.Testing
Keycloak-to-Keycloak brokering on a kind cluster tests everything automatically, with no cloud account: realm A brokers to realm B, the Kubernetes identity provider supplies A's token, and B validates it with the existing federated client authentication. Nothing in the mechanism is vendor-specific.
Ambient sources are tested against a stub metadata service in the test suite. Only the request to the metadata service is platform-specific; the token rules and the client authentication are the same code path as above.
Milestones
Questions
We could help with this, if it's a direction you'd like to take.
All reactions