Skip to content

Fix SAML artifact binding failing to validate signed nested samlp:Response#50862

Merged
pskopek merged 2 commits into
keycloak:mainfrom
jimmychakkalakal:bug/Fix-50684-SAML_validate_signed_nested_samlp_Response
Jul 17, 2026
Merged

Fix SAML artifact binding failing to validate signed nested samlp:Response#50862
pskopek merged 2 commits into
keycloak:mainfrom
jimmychakkalakal:bug/Fix-50684-SAML_validate_signed_nested_samlp_Response

Conversation

@jimmychakkalakal

Copy link
Copy Markdown
Contributor

Fix SAML artifact binding failing to validate signed nested samlp:Response

Closes #50684

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.

Pull request overview

Adds support for validating signed SAML responses nested inside artifact responses.

Changes:

  • Registers ID attributes on signable nested protocol elements.
  • Recognizes valid nested protocol signatures.
  • Adds regression tests for nested and root signatures.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
JBossSAMLConstants.java Defines signable protocol elements.
SAML2Signature.java Registers nested protocol IDs.
XMLSignatureUtil.java Accepts nested protocol signatures.
SAML2SignatureTest.java Tests artifact-response signatures.

@jimmychakkalakal
jimmychakkalakal force-pushed the bug/Fix-50684-SAML_validate_signed_nested_samlp_Response branch from 54bc5e4 to 53d0031 Compare July 14, 2026 10:43
@jimmychakkalakal
jimmychakkalakal requested a review from Copilot July 14, 2026 10:44

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.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

@jimmychakkalakal
jimmychakkalakal force-pushed the bug/Fix-50684-SAML_validate_signed_nested_samlp_Response branch from 53d0031 to b1f1bdf Compare July 14, 2026 10:58
@jimmychakkalakal
jimmychakkalakal requested a review from Copilot July 14, 2026 11:00

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.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

@jimmychakkalakal
jimmychakkalakal marked this pull request as ready for review July 14, 2026 11:04
@jimmychakkalakal
jimmychakkalakal requested a review from a team as a code owner July 14, 2026 11:04
Copilot AI review requested due to automatic review settings July 14, 2026 13:41
@jimmychakkalakal
jimmychakkalakal force-pushed the bug/Fix-50684-SAML_validate_signed_nested_samlp_Response branch from b1f1bdf to 87eb7ab Compare July 14, 2026 13:41

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.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Copilot AI review requested due to automatic review settings July 15, 2026 09:09
@jimmychakkalakal
jimmychakkalakal force-pushed the bug/Fix-50684-SAML_validate_signed_nested_samlp_Response branch from 87eb7ab to 21e7b98 Compare July 15, 2026 09:09

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.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Comment on lines +335 to +339
public static final Set<JBossSAMLConstants> SIGNED_PROTOCOL_ELEMENTS = Set.of(
RESPONSE__PROTOCOL,
LOGOUT_REQUEST,
LOGOUT_RESPONSE
);

@keycloak-github-bot keycloak-github-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unreported flaky test detected, please review

@keycloak-github-bot

Copy link
Copy Markdown

Unreported flaky test detected

If the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR.

org.keycloak.testsuite.cluster.RealmInvalidationClusterTest#crudWithFailover

Keycloak CI - Store IT (oracle)

org.opentest4j.AssertionFailedError: expected: <false> but was: <true>
	at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
	at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
	at org.junit.jupiter.api.AssertFalse.failNotFalse(AssertFalse.java:63)
	at org.junit.jupiter.api.AssertFalse.assertFalse(AssertFalse.java:36)
...

Report flaky test

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

LGTM

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

Thanks @jimmychakkalakal! LGTM in general, just a few suggestion to make it more readable. Just for your consideration, they are more nitpicks than real issues.

Copilot AI review requested due to automatic review settings July 17, 2026 08:58
validate signed nested samlp:Response

Closes keycloak#50684

Signed-off-by: Jimmy Chakkalakal <jimmy.chakkalakal@ibm.com>
…re readable

Closes keycloak#50342

Signed-off-by: Jimmy Chakkalakal <jimmy.chakkalakal@ibm.com>
@jimmychakkalakal
jimmychakkalakal force-pushed the bug/Fix-50684-SAML_validate_signed_nested_samlp_Response branch from 66e00d7 to 582cb62 Compare July 17, 2026 08:59

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.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

@jimmychakkalakal

Copy link
Copy Markdown
Contributor Author

@rmartinc Thanks for the nitpick suggestions. I have implemented those. The code is now more readable and clean. Please review when you have time. Thanks in advance!

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

Thanks @jimmychakkalakal! LGTM!

@pskopek
pskopek merged commit 86df0eb into keycloak:main Jul 17, 2026
91 checks passed
shawkins pushed a commit to shawkins/keycloak that referenced this pull request Jul 17, 2026
…ponse (keycloak#50862)

* Fix SAML artifact binding failing to
validate signed nested samlp:Response

Closes keycloak#50684

Signed-off-by: Jimmy Chakkalakal <jimmy.chakkalakal@ibm.com>

* Worked on reviewers nitpicks suggestions, that made code clean and more readable

Closes keycloak#50342

Signed-off-by: Jimmy Chakkalakal <jimmy.chakkalakal@ibm.com>

---------

Signed-off-by: Jimmy Chakkalakal <jimmy.chakkalakal@ibm.com>
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 broker artifact binding fails to validate signed nested Response inside ArtifactResponse: Cannot resolve element with ID

5 participants