8000 Only use a managed user for getUserByUsername/getUserByEmail if it ma… by sguilhen · Pull Request #55555 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

Only use a managed user for getUserByUsername/getUserByEmail if it ma… - #55555

Open
sguilhen wants to merge 1 commit into
keycloak:mainfrom
sguilhen:54646-usercache-realm-check
Open

sguilhen wants to merge 1 commit into
keycloak:mainfrom
sguilhen:54646-usercache-realm-check

Conversation

@sguilhen
@sguilhen sguilhen commented Nov 25, 2026 •
Copy link
Copy Markdown
Contributor

…tches the realm

getUserById already falls back to a fresh lookup when a managed user with the same id belongs to a different realm; getUserByUsername/getUserByEmail (added in #54646) only used that check to decide whether to cache the query, but still returned the managed user regardless of a realm mismatch.

Closes #55554

@sguilhen
sguilhen requested review from a team as code owners November 25, 2026 19:22
Copilot AI balanced review requested due to automatic review settings November 25, 2026 19:22
Copilot AI 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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

…tches the realm

getUserById already falls back to a fresh lookup when a managed user with the
same id belongs to a different realm; getUserByUsername/getUserByEmail (added
in keycloak#54646) only used that check to decide whether to cache the query, but
still returned the managed user regardless of a realm mismatch.

Closes keycloak#55554

Signed-off-by: Stefan Guilhen <sguilhen@redhat.com>
@sguilhen
sguilhen force-pushed the 54646-usercache-realm-check branch from 02a54c7 to 1672685 Compare November 25, 2026 19:25
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

Successfully merging this pull request may close these issues.

Username/email cache lookup can return a managed user from a different realm

2 participants

0