Log SubjectConfirmationData validation failure in SAMLEndpoint#49262
Open
hammadxcm wants to merge 1 commit into
Open
Log SubjectConfirmationData validation failure in SAMLEndpoint#49262hammadxcm wants to merge 1 commit into
hammadxcm wants to merge 1 commit into
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>
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.
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.