Generate ID token if it is not refreshed #29214
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #29144
This PR addresses a case where a provider does not return a new ID token after a token refresh in a similar way we handle GitHub and other OAuth2-only provider responses for the initial authorization code flow exchanges which is used in Renarde - we generate an internal ID token but besides we also preserve the orginal ID token claims in the newly generated ID token for the application to keep which needs access to the ID token claims - because it works for such application at the start where an original ID token is returned.
Here is a summary, most of the time was spent on getting the test passing:
quarkus.oidc.authentication.id-token-required=false
OidcResource
test resource emulating OIDC provider does not return ID token during the refresh (Keycloak based tests will have real refresh token returned so all the variations are covered)This is really it, no OIDC logic is affected, just a support for extending the session in those users where providers other than Keycloak do not recycle ID tokens...
CC @pedroigor