Repository navigation
Adds a migration documentation for token exchange v1 to v2 (external-to-internal) - #55425
Conversation
…to-internal) Closes keycloak#47626 Signed-off-by: Jimmy Chakkalakal <jimmy.chakkalakal@ibm.com>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the documentation-only migration guidance and related cross-links.
No open issues 🎉
What changed in this PR
Adds documentation for migrating legacy external-to-internal Token Exchange V1 to JWT Authorization Grant or identity brokering, addressing issue #47626. No runtime code changes are included.
Changes:
- Explains migration paths, including combining Standard Token Exchange V2 with JWT Authorization Grant across realms.
- Documents user provisioning, assertion requirements, Google support, and refresh-token differences, with request examples and a validation checklist.
- Links the migration guide from the existing token exchange and JWT Authorization Grant guides.
| File | Description |
|---|---|
docs/guides/securing-apps/token-exchange.adoc |
Links legacy external-to-internal exchange documentation to the migration guide. |
docs/guides/securing-apps/token-exchange-migration-external-internal.adoc |
Adds migration paths, configuration steps, request examples, and validation guidance. |
docs/guides/securing-apps/jwt-authorization-grant.adoc |
Links to migration guidance on user linking and token handling. |
Review effort: Balanced
There was a problem hiding this comment.
@jimmychakkalakal Thanks a lot for the PR!
As mentioned in the #55411 (review) , it can be better to use single "migration guide" and use individual use-cases . Which means that this PR may need to possibly wait until #55411 is merged? But I am reviewing anyway even if this PR may need some rebase later...
IMO also worth to mention that JWT authorization grant and identity chaining does not depends on fine-grained admin permissions anymore (TE V1 depends on that). Something similar like you mentioned in the other PR for internal-internal #55411 ?
Few other minor comments inline
| Legacy external-internal exchange can import a new user into the destination realm and can return a refresh token. | ||
| These behaviors differ from JWT Authorization Grant, so migration involves reviewing user provisioning and token handling as well as changing the request parameters. | ||
|
|
||
| NOTE: This guide covers only external-to-internal token exchange (exchanging a token from an external identity provider for a {project_name} token). |
There was a problem hiding this comment.
Maybe this NOTE is not needed and can be removed? Especially considering that this would be sub-chapter of the "Migration" chapter, which would contain all the other migrations for other TE use-cases, and hence it is maybe implicit that other cases are covered in the other subchapter?
| |Complete identity brokering through the browser, or provision the local account and federated identity link before using JWT Authorization Grant. See <<_external-internal-migration-users,User creation and account linking>>. | ||
|
|
||
| |The application has only an opaque external access token. | ||
| |That token cannot be submitted as a JWT assertion. Use browser-based link:{adminguide_link}#identity_broker[Identity Brokering] to obtain a {project_name} token, or obtain a suitable signed JWT from an issuer supported by JWT Authorization Grant. |
There was a problem hiding this comment.
| |That token cannot be submitted as a JWT assertion. Use browser-based link:{adminguide_link}#identity_broker[Identity Brokering] to obtain a {project_name} token, or obtain a suitable signed JWT from an issuer supported by JWT Authorization Grant. | |
| |That token cannot be submitted as a JWT assertion. Use browser-based link:{adminguide_link}#_identity_broker[Identity Brokering] to obtain a {project_name} token, or obtain a suitable signed JWT from an issuer supported by JWT Authorization Grant. |
Seems correct link is #_identity_broker?
| The assertion must be a signed JWT that the configured identity provider can validate. | ||
| An arbitrary external access token does not necessarily meet the grant's requirements. | ||
|
|
||
| For the OIDC and generic JWT Authorization Grant provider types, check the following: |
There was a problem hiding this comment.
it is maybe better to not list the requirements for the claims, but rather link the corresponding section ( https://www.keycloak.org/securing-apps/jwt-authorization-grant ), which mentions those requirements?
In general, it is better to link existing docs instead of "copy docs" to avoid having same docs on more places (as same docs on more places introduces the risk that when some requirement is changed in the future, there are multiple places of the documentation, which needs to be changed, which increases the risk that some place in the documentation would be forgotten...)
|
|
||
| == Update session and response handling | ||
|
|
||
| JWT Authorization Grant returns an access token and creates a transient user session. |
There was a problem hiding this comment.
Maybe worth to mention in more details (maybe with some note) what exactly is transient user session as it may not be clear for the reader. Maybe with the link to the corresponding section of admin guide - https://www.keycloak.org/docs/latest/server_admin/index.html#_transient-session
|
Tracking the review updates while this PR waits for #55411 to merge. The updates are pushed to the working branch issues/47626-external-internal-review-stacked, currently at a18395a073. This branch is stacked on #55411's current head, The prepared changes move external-internal migration into the shared migration guide, remove the redundant scope NOTE, replace duplicated assertion requirements and Google validation details with references to the JWT Authorization Grant guide, verify the Identity Brokering links, and add the FGAP clarification and transient-session NOTE requested in review. Further work can continue on the working branch. After #55411 merges, rebase it onto updated upstream git switch issues/47626-external-internal-review-stacked
git fetch upstream
git rebase --onto upstream/main 2bb8b2f1b4013218ac3c43cce42f8e5d98267d9eThis replays only the commits after #55411's recorded head: currently Validation completed for the prepared changes: documentation package build, docs-module Spotless, generated heading and link checks, and shell syntax checks for the curl examples. |
Adds a migration documentation for token exchange v1 to v2 (external-to-internal)
Closes #47626