Repository navigation
Dynamic scopes: requested scopes get mixed up between token requests - #48955
Merged
Merged
Conversation
Closes keycloak#12223 Signed-off-by: Martin Bartoš <mabartos@redhat.com>
Closed
ahus1
pushed a commit
that referenced
this pull request
Jun 29, 2026
* Dynamic scopes: requested scopes get mixed up between token requests (#48955) Closes #12223 Signed-off-by: Martin Bartoš <mabartos@redhat.com> * RAR scope parsing should explicitly accept client reference (#48981) Closes #48980 Closes #45716 Signed-off-by: Martin Bartoš <mabartos@redhat.com> --------- Signed-off-by: Martin Bartoš <mabartos@redhat.com> Co-authored-by: Martin Bartoš <mabartos@redhat.com>
sashyo
pushed a commit
to tide-foundation/keycloak-IGA
that referenced
this pull request
Jul 20, 2026
…eycloak#48955) Closes keycloak#12223 Signed-off-by: Martin Bartoš <mabartos@redhat.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The
AuthenticatedClientSessionis designed to be 1:1 to the client and user, so notes related to the client session are mutable and shared. It means when there are multiple authz code requests with different scopes required (shop:10, and then shop:20), it uses the same client session, and the notes are overwritten. The original issue is quite old, and some things have already changed since that time. As for the refresh token, scopes are not obtained from the client session notes, but rather from the attached scopes in the token - which is the required behavior.However, for dynamic scopes, these scopes were always obtained from the client session note, which is not correct (for non-dynamic scopes, the issue was already resolved over the years).
See: #12009
@keycloak/core-authn Could you please check it? Thanks!