8000 Dynamic scopes: requested scopes get mixed up between token requests by mabartos · Pull Request #48955 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

Dynamic scopes: requested scopes get mixed up between token requests - #48955

Merged
rmartinc merged 1 commit into
keycloak:mainfrom
mabartos:KC-12223
May 13, 2026
Merged

rmartinc merged 1 commit into
keycloak:mainfrom
mabartos:KC-12223

Conversation

@mabartos
@mabartos mabartos commented May 13, 2026 •
Copy link
Copy Markdown
Member

The AuthenticatedClientSession is 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!

Closes keycloak#12223

Signed-off-by: Martin Bartoš <mabartos@redhat.com>
@rmartinc rmartinc left a comment •
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @mabartos! It was finally easier than I expected. Approved!

@rmartinc
rmartinc merged commit b49a51b into keycloak:main May 13, 2026
147 of 152 checks passed
@stianst stianst mentioned this pull request Jun 1, 2026
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dynamic scopes: requested scopes get mixed up between token requests

2 participants

0