Skip to content

Propagate SAML session ID change setting in DeploymentBuilder - #49604

Merged
mposolda merged 1 commit into
keycloak:mainfrom
SchubertS96:fix/issue-49601
Nov 13, 2026
Merged

mposolda merged 1 commit into
keycloak:mainfrom
SchubertS96:fix/issue-49601

Conversation

@SchubertS96

Copy link
Copy Markdown

Summary

  • preserve the turnOffChangeSessionIdOnLogin SP setting when DeploymentBuilder creates the runtime SAML deployment
  • add a focused regression test covering the mapped SP configuration fields in DeploymentBuilder

Testing

  • .\mvnw.cmd -pl adapters/saml/core -am -Dtest=DeploymentBuilderTest test
  • .\mvnw.cmd spotless:apply

Issue

Closes #49601

AI usage

AI agents were used to help draft and refine the code changes and test updates. All changes were reviewed and understood before submission.

Copilot AI balanced review requested due to automatic review settings September 21, 2026 11:48

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.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

Review effort: Lite
Findings: 1 Medium severity

Open (1)
What changed in this PR

Propagates the SAML SP setting turnOffChangeSessionIdOnLogin into the runtime SamlDeployment built by DeploymentBuilder, and adds a regression test to ensure key SP configuration fields are mapped correctly.

Changes:

  • Map turnOffChangeSessionIdOnLogin from SP config into SamlDeployment in DeploymentBuilder.
  • Add a new SAML adapter XML test resource containing representative SP/IDP settings (including the new flag).
  • Add a focused regression test that asserts DeploymentBuilder maps select SP fields as expected.
File Description
adapters/​saml/​core/​src/​main/​java/​org/​keycloak/​adapters/​saml/​config/​parsers/​DeploymentBuilder.java Propagates the turnOffChangeSessionIdOnLogin SP setting into the built deployment.
adapters/​saml/​core/​src/​test/​java/​org/​keycloak/​adapters/​saml/​DeploymentBuilderTest.java Adds a regression test for SP-field mapping and refactors XML loading into a helper.
adapters/​saml/​core/​src/​test/​resources/​org/​keycloak/​adapters/​saml/​config/​parsers/​keycloak-saml-deployment-builder-mapping.xml New test fixture XML capturing SP/IDP settings used by the mapping regression test.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@lhanusov lhanusov 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.

@SchubertS96 Hi Sebastian, can you please rebase to latest main? Fix and tests seems ok, to me.

Preserve the SP turnOffChangeSessionIdOnLogin setting when building the runtime SAML deployment and add a regression test for the mapped SP configuration fields.

Closes keycloak#49601

Signed-off-by: Sebastian Schubert <sebastian.schubert@tngtech.com>
Copilot AI balanced review requested due to automatic review settings November 10, 2026 19:35

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.

🟢 Approval recommended

There are no active review issues for the change preserving the configured SAML session-ID behavior.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@SchubertS96

Copy link
Copy Markdown
Author

@lhanusov Hi Lukas, sorry for the delay. Rebase is done.

@mposolda mposolda 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.

@mposolda mposolda self-assigned this Nov 13, 2026
@mposolda
mposolda merged commit c7060c7 into keycloak:main Nov 13, 2026
96 checks passed
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.

SAML adapter ignores turnOffChangeSessionIdOnLogin in DeploymentBuilder

5 participants