8000 Introduce ExternalToInternalTokenExchangeProvider. Make it working wi… by mposolda · Pull Request #40134 · keycloak/keycloak · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Introduce ExternalToInternalTokenExchangeProvider. Make it working wi… #40134

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

mposolda
Copy link
Contributor
@mposolda mposolda commented Jun 2, 2025

…th Google IDP using token-info endpoint instead of user-info endpoint

closes #40146
closes #40133

  • PR introduces provider ExternalToInternalTokenExchangeProvider and the feature TOKEN_EXCHANGE_EXTERNAL_INTERNAL_V2 . See Introduce external-internal token exchange provider #40146 for some reasoning for using "external internal" only for now and make it separated from "internal external" .

  • Similarly like we did for "standard token exchange", we may want to develop supported "external internal" and at the same time make the token-exchange:v1 works the same as before. This means also that Identity providers may need to behave differently for V1 and V2. Due to this, I've added the method getVersion on the TokenExchangeProvider and methods like exchangeExternalTokenV1Impl and exchangeExternalTokenV2Impl on the Identity provider.

  • The exchangeExternalTokenV1Impl works the same as before for V1 token exchange.

  • The exchangeExternalTokenV2Impl is implemented only for Google provider now. So Google is the only provider, which works with ExternalToInternalTokenExchangeProvider right now. Instead of using only user-info endpoint for the verification (like V1 is doing), The V2 uses token-verification, which works with Google token-info endpoint and checks that token has expected audience. See some details in the GH issue Verification of external google token by Google token-info endpoint #40133 and in the google doc regarding this.

Other providers (OIDC, other social providers) can hopefully be done in a follow-up PRs. 8000 Created some subtasks of #40132 for this.

@mposolda mposolda self-assigned this Jun 2, 2025
…th Google IDP using token-info endpoint instead of user-info endpoint

closes keycloak#40146
closes keycloak#40133

Signed-off-by: mposolda <mposolda@gmail.com>
Copy link
Contributor
@graziang graziang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mposolda Thanks, good start for external to internal! I create the task to add the tests

@mposolda
Copy link
Contributor Author
mposolda commented Jun 4, 2025

@graziang Thanks for the review

@mposolda mposolda merged commit ab7edb0 into keycloak:main Jun 4, 2025
76 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development
4219

Successfully merging this pull request may close these issues.

Introduce external-internal token exchange provider Verification of external google token by Google token-info endpoint
2 participants
0