-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Closed as not planned
Closed as not planned
Copy link
Labels
area/token-exchange/federatedIssues related to federated token exchange (external-internal or internal-external)Issues related to federated token exchange (external-internal or internal-external)kind/task
Description
Description
When performing an external-internal token exchange, Keycloak needs to figure out which IDP issued the external subject_token.
Current behavior
- If the
subject_tokenis a JWT (withsubject_token_type = urn:ietf:params:oauth:token-type:jwt), Keycloak reads the token and compares theissclaim with the issuers of the IDPs configured in the realm. - If the token is not a JWT, the request must include a
subject_issuerparameter to indicate which IDP issued the token. However, this parameter is not part of the standard OAuth 2.0 Token Exchange specification.
Possible improvements
- For JWT tokens: keep the current behavior — try to determine the IDP based on the
issclaim in the token. This approach is aligned with the specification and does not require any non-standard parameters. - For non-JWT tokens: replace the
subject_issuerparameter with a better-named alternative likekc_subject_idporkc_subject_issuer, following the naming convention used for other non-standard parameters in Keycloak likekc_idp_hint. The value of this parameter could be either the IDP alias or the result ofExchangeExternalToken.isIssuer().
Metadata
Metadata
Assignees
Labels
area/token-exchange/federatedIssues related to federated token exchange (external-internal or internal-external)Issues related to federated token exchange (external-internal or internal-external)kind/task