Repository navigation
Conversation
Closes keycloak#55263 AI Disclosure: This commit was authored with the assistance of an AI coding tool. All changes were reviewed and approved by the committer. Signed-off-by: Bruno Oliveira da Silva <bruno@abstractj.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The upgrade-note fragment is not included in the published upgrading guide, leaving users without mandatory custom-mapper rebuild instructions.
1 open issue
What changed in this PR
This PR addresses #55263 by updating SAML adapter logout to invalidate all local sessions sharing a session index and preserve the asserted NameID independently of the configured principal name.
Changes:
- Extend the session-mapper SPI to return all matching sessions and update Elytron logout and cleanup.
- Preserve the original SAML subject when using attribute-based principal names.
- Add regression tests and migration guidance for custom session mappers.
| File | Description |
|---|---|
| testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/SAMLLogoutAdapterTest.java | Tests shared-index logout and NameID logout with attribute principals. |
| docs/documentation/upgrading/topics/changes/changes-next-saml-session-id-mapper.adoc | Adds SPI migration and existing-session guidance. |
| adapters/spi/adapter-spi/src/test/java/org/keycloak/adapters/spi/InMemorySessionIdMapperTest.java | Tests multiple mappings, removal, snapshots, and remapping. |
| adapters/spi/adapter-spi/src/main/java/org/keycloak/adapters/spi/SessionIdMapper.java | Adds multi-session lookup and deprecates single-session lookup. |
| adapters/spi/adapter-spi/src/main/java/org/keycloak/adapters/spi/InMemorySessionIdMapper.java | Stores multiple sessions per index with synchronized access. |
| adapters/saml/wildfly-elytron/src/test/java/org/keycloak/adapters/saml/elytron/ElytronSamlSessionStoreTest.java | Tests logout of all matching sessions without duplicates. |
| adapters/saml/wildfly-elytron/src/main/java/org/keycloak/adapters/saml/elytron/IdMapperUpdaterSessionListener.java | Removes mappings even when no session index exists. |
| adapters/saml/wildfly-elytron/src/main/java/org/keycloak/adapters/saml/elytron/ElytronSamlSessionStore.java | Logs out all matching sessions and handles missing session scopes. |
| adapters/saml/core/src/main/java/o 8000 rg/keycloak/adapters/saml/profile/AbstractSamlAuthenticationHandler.java | Separates the asserted SAML subject from the principal display name. |
Review effort: Balanced
|
|
||
| === SAML adapter session mapper | ||
|
|
||
| Custom implementations of `org.keycloak.adapters.spi.SessionIdMapper` must implement `getSessionsFromSSO(String)` and be rebuilt before upgrading the adapter. |
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.

Closes #55263
AI Disclosure: This commit was authored with the assistance of an AI coding tool. All changes were reviewed and approved by the committer.