Skip to content

Log SubjectConfirmationData validation failure in SAMLEndpoint#49262

Open
hammadxcm wants to merge 1 commit into
keycloak:mainfrom
hammadxcm:fix-48417
Open

Log SubjectConfirmationData validation failure in SAMLEndpoint#49262
hammadxcm wants to merge 1 commit into
keycloak:mainfrom
hammadxcm:fix-48417

Conversation

@hammadxcm

Copy link
Copy Markdown
Contributor

Summary

When validateSubjectConfirmationData() fails during IdP-brokered SAML response handling, the request is rejected with INVALID_SAML_RESPONSE but no log entry or event reason is emitted. This is a regression from f0381f8 ("Check SubjectConfirmationData element for bearer type") and makes the failure undiagnosable at the default log level.

The sibling validations in the same handler — the issuer check and validateInResponseToAttribute() — both log an error before failing. This change adds a matching logger.error to validateSubjectConfirmationData() so the behaviour is consistent.

The detailed failure reasons (recipient / InResponseTo / expiry) continue to be logged at trace level by SubjectConfirmationDataValidator.

Testing

Logging-only change on a path that is hard to reproduce (requires a brokered SAML IdP returning an invalid subject confirmation), so no automated test is added; the change mirrors the existing logging in the same method's siblings.

Closes #48417


AI agents were used to assist with locating the code path and drafting this change.

When validateSubjectConfirmationData() fails, no log entry or event reason was emitted, unlike the issuer and InResponseTo validations in the same handler. Add an error log so the failure is diagnosable at the default log level.

Closes keycloak#48417

Signed-off-by: hammadxcm <hammadkhanxcm@gmail.com>
@hammadxcm hammadxcm requested a review from a team as a code owner May 23, 2026 06:43
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.

No information in log by subject confirmation validation after commit f0381f8482272698264d8951705f61c5f9c09fba

2 participants