From 3feb809b354ade3c6de9dd89a3e75ac1267ac9af Mon Sep 17 00:00:00 2001 From: Steve Riesenberg Date: Tue, 12 Sep 2023 18:33:36 -0500 Subject: [PATCH] Fix Saml2AuthenticationExceptionMixin on JDK 17 Closes gh-13804 --- .../jackson2/Saml2AuthenticationExceptionMixin.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/saml2/saml2-service-provider/src/main/java/org/springframework/security/saml2/jackson2/Saml2AuthenticationExceptionMixin.java b/saml2/saml2-service-provider/src/main/java/org/springframework/security/saml2/jackson2/Saml2AuthenticationExceptionMixin.java index 3bbee42f240..1e739c38f46 100644 --- a/saml2/saml2-service-provider/src/main/java/org/springframework/security/saml2/jackson2/Saml2AuthenticationExceptionMixin.java +++ b/saml2/saml2-service-provider/src/main/java/org/springframework/security/saml2/jackson2/Saml2AuthenticationExceptionMixin.java @@ -34,10 +34,16 @@ * @see Saml2Jackson2Module */ @JsonTypeInfo(use = JsonTypeInfo.Id.CLASS) -@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY, getterVisibility = JsonAutoDetect.Visibility.NONE, +@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.NONE, getterVisibility = JsonAutoDetect.Visibility.NONE, isGetterVisibility = JsonAutoDetect.Visibility.NONE) @JsonIgnoreProperties(ignoreUnknown = true, value = { "cause", "stackTrace", "suppressedExceptions" }) -class Saml2AuthenticationExceptionMixin { +abstract class Saml2AuthenticationExceptionMixin { + + @JsonProperty("error") + abstract Saml2Error getSaml2Error(); + + @JsonProperty("detailMessage") + abstract String getMessage(); @JsonCreator Saml2AuthenticationExceptionMixin(@JsonProperty("error") Saml2Error error,