Describe the bug
Jackson serialization of DefaultSaml2AuthenticatedPrincipal doesn't work anymore since Spring Boot 2.7.3.
An exception is thrown:
Caused by: com.fasterxml.jackson.databind.JsonMappingException: The class with org.springframework.util.LinkedMultiValueMap and name of org.springframework.util.LinkedMultiValueMap is not in the allowlist.
To Reproduce
Setup a Jackson object mapper like that
val springSecurityObjectMapper: JsonMapper = jacksonMapperBuilder()
.addModules(SecurityJackson2Modules.getModules(Companion::class.java.classLoader))
Then try to use the mapper to serialize an Authentication containing a DefaultSaml2AuthenticatedPrincipal constructed by OpenSaml4AuthenticationProvider.
Expected behavior
Serialization works.
Probable cause
I think this is the offending commit e092ec7
Describe the bug
Jackson serialization of
DefaultSaml2AuthenticatedPrincipaldoesn't work anymore since Spring Boot 2.7.3.An exception is thrown:
To Reproduce
Setup a Jackson object mapper like that
Then try to use the mapper to serialize an
Authenticationcontaining aDefaultSaml2AuthenticatedPrincipalconstructed byOpenSaml4AuthenticationProvider.Expected behavior
Serialization works.
Probable cause
I think this is the offending commit e092ec7