Repository navigation
Disabled organization set on session context during broker login call… - #52832
Conversation
e63ea8c to
fd762cb
Compare
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The regression test does not exercise either changed production branch and belongs in the new test framework.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1
Open (3)
What changed in this PR
Prevents disabled organizations from propagating through broker login context or OIDC token claims.
Changes:
- Guards broker organization context assignment.
- Filters disabled organizations from single-valued claims.
- Adds regression coverage.
| File | Description |
|---|---|
LoginActionsService.java |
Validates organization status before setting context. |
OrganizationMembershipMapper.java |
Omits disabled organization claims. |
AbstractBrokerSelfRegistrationTest.java |
Adds disabled-organization login coverage. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
@vramik Thanks for the PR.
Could you update the test to reproduce the broker-callback issue? I commented out both production changes, and the test still passes. The password login after disabling the organization bypasses the changed broker flow.
…back Closes keycloak#52831 Signed-off-by: vramik <vramik@redhat.com>
fd762cb to
77701cc
Compare
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Disabled organizations can still cause token failure or persist through authentication-session resolution, and regression coverage is missing.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1
| OrganizationModel org = organizations.get(0); | ||
| if (!org.isEnabled()) { | ||
| return null; |
@martin-kanis thank you, I ended up removing the test altogether. Here's why:
Both fixes are defense-in-depth. They protect against future code changes that might bypass the outer filters (e.g., a new authenticator that reads the context org without checking |



…back
Closes #52831