Add reason details in event before error event is submitted for broken SAML requests (#29948)

Previously the reason was omitted in the details because it was set after the event was already submitted.

Fixes #29948

Signed-off-by: Thomas Darimont <thomas.darimont@googlemail.com>
This commit is contained in:
Thomas Darimont 2024-05-28 23:53:13 +02:00 committed by Alexander Schwartz
parent bbb83236f5
commit 4edb204777

View file

@ -291,8 +291,8 @@ public class SamlService extends AuthorizationEndpointBase {
event.event(EventType.LOGOUT); event.event(EventType.LOGOUT);
} else { } else {
event.event(EventType.LOGIN); event.event(EventType.LOGIN);
event.error(Errors.INVALID_TOKEN);
event.detail(Details.REASON, "Unhandled SAML document type: " + (samlObject == null ? "<null>" : samlObject.getClass().getSimpleName())); event.detail(Details.REASON, "Unhandled SAML document type: " + (samlObject == null ? "<null>" : samlObject.getClass().getSimpleName()));
event.error(Errors.INVALID_TOKEN);
return error(session, null, Response.Status.BAD_REQUEST, Messages.INVALID_REQUEST); return error(session, null, Response.Status.BAD_REQUEST, Messages.INVALID_REQUEST);
} }