Repository navigation
Reject a different brokered user on forced re-authentication before c… - #54462
Merged
pedroigor merged 1 commit intoNov 6, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The new guard rejects unlinked identities before first-broker-login can resolve them to the existing session user, breaking previously successful login and auto-link flows.
1 open issue
What changed in this PR
This PR addresses #54344 by rejecting a different brokered user during forced re-authentication before first-broker-login can create an account without an identity-provider link.
Changes:
- Adds an early check against the user holding the existing session.
- Adds regression tests for rejection, event reporting, subsequent login, same-user re-authentication, and explicit account linking.
| File | Description |
|---|---|
tests/base/src/test/java/org/keycloak/tests/broker/KcOidcBrokerForcedReauthenticationDifferentUserTest.java |
Adds integration coverage for forced re-authentication and account-linking behavior. |
services/src/main/java/org/keycloak/services/resources/IdentityBrokerService.java |
Checks the existing session user before starting first-broker-login. |
Review effort: Balanced
sguilhen
force-pushed
the
54344-reject-different-user-broker
branch
from
October 30, 2026 17:16
e72be3f to
a943682
Compare
…reating it Closes keycloak#54344 Signed-off-by: Stefan Guilhen <sguilhen@redhat.com>
pedroigor
force-pushed
the
54344-reject-different-user-broker
branch
from
November 6, 2026 13:18
a943682 to
bab7289
Compare
pedroigor
approved these changes
Nov 6, 2026
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.

…reating it
Closes #54344