Repository navigation
Conversation
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>
There was a problem hiding this comment.
Pull request overview
This PR restores diagnosability for IdP-brokered SAML response failures by emitting an error-level log entry when validateSubjectConfirmationData() fails inside SAMLEndpoint, aligning it with the existing issuer and InResponseTo validation logging behavior.
Changes:
- Add an
errorlog entry whenSubjectConfirmationDataValidatorreports invalid SubjectConfirmationData during brokered SAML response handling.
Unreported flaky test detectedIf 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.PermissionTicketInvalidationClusterTest#crudWithFailover |
|
Please avoid merging the main branch into the PR or rebasing the PR unless there are merge conflicts reported by GitHub or a reviewer asks you for a rebase. This prevents spamming reviewers with notifications and saves minutes on the GitHub actions CI. Thanks! |
|
Apologies, noted — will leave it alone unless conflicts appear or a reviewer asks. Thanks! |
Summary
When
validateSubjectConfirmationData()fails during IdP-brokered SAML response handling, the request is rejected withINVALID_SAML_RESPONSEbut 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 matchinglogger.errortovalidateSubjectConfirmationData()so the behaviour is consistent.The detailed failure reasons (recipient / InResponseTo / expiry) continue to be logged at
tracelevel bySubjectConfirmationDataValidator.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.