KEYCLOAK-15460 Fix missing event types in SAML endpoint

A change was done in 32f13016fa which isn't setting the type for events and causing an internal error.
This commit is contained in:
Mark Wolfe 2020-09-16 09:16:50 +10:00 committed by Hynek Mlnařík
parent 5d5e56dde3
commit 3723d78e3c

View file

@ -258,6 +258,7 @@ public class SAMLEndpoint {
RequestAbstractType requestAbstractType = (RequestAbstractType) holder.getSamlObject(); RequestAbstractType requestAbstractType = (RequestAbstractType) holder.getSamlObject();
// validate destination // validate destination
if (requestAbstractType.getDestination() == null && containsUnencryptedSignature(holder)) { if (requestAbstractType.getDestination() == null && containsUnencryptedSignature(holder)) {
event.event(EventType.IDENTITY_PROVIDER_RESPONSE);
event.detail(Details.REASON, "missing_required_destination"); event.detail(Details.REASON, "missing_required_destination");
event.error(Errors.INVALID_REQUEST); event.error(Errors.INVALID_REQUEST);
return ErrorPage.error(session, null, Response.Status.BAD_REQUEST, Messages.INVALID_REQUEST); return ErrorPage.error(session, null, Response.Status.BAD_REQUEST, Messages.INVALID_REQUEST);
@ -518,6 +519,7 @@ public class SAMLEndpoint {
StatusResponseType statusResponse = (StatusResponseType)holder.getSamlObject(); StatusResponseType statusResponse = (StatusResponseType)holder.getSamlObject();
// validate destination // validate destination
if (statusResponse.getDestination() == null && containsUnencryptedSignature(holder)) { if (statusResponse.getDestination() == null && containsUnencryptedSignature(holder)) {
event.event(EventType.IDENTITY_PROVIDER_RESPONSE);
event.detail(Details.REASON, "missing_required_destination"); event.detail(Details.REASON, "missing_required_destination");
event.error(Errors.INVALID_SAML_LOGOUT_RESPONSE); event.error(Errors.INVALID_SAML_LOGOUT_RESPONSE);
return ErrorPage.error(session, null, Response.Status.BAD_REQUEST, Messages.INVALID_REQUEST); return ErrorPage.error(session, null, Response.Status.BAD_REQUEST, Messages.INVALID_REQUEST);