Describe the bug When running a native spring boot image with spring security and redis sessions I get an error both with JDK serialization and the json serialization when trying to login via oauth2. It looks like there is this bug in spring session which seems related.

Specifically for the jackson error it looks like this not all the modules are in the loader

SecurityJackson2Modules.getModules(this.loader)

in particular these

org.springframework.security.oauth2.client.jackson2.OAuth2ClientJackson2Module
org.springframework.security.web.jackson2.WebJackson2Module
org.springframework.security.web.server.jackson2.WebServerJackson2Module

are missing in the native image, but not the non-native image

To Reproduce The Steps to reproduce are in the readme of the sample

Expected behavior There should be no error when running a native image

Sample

Sample

A snippet from the error

org.springframework.data.redis.serializer.SerializationException: Could not read JSON:Class org.springframework.security.oauth2.client.jackson2.OAuth2AuthorizationRequestDeserializer has no default (no arg) constructor