|
36 | 36 | import com.fasterxml.jackson.core.JsonProcessingException; |
37 | 37 | import com.fasterxml.jackson.databind.Module; |
38 | 38 | import com.fasterxml.jackson.databind.ObjectMapper; |
| 39 | +import tools.jackson.databind.JacksonModule; |
39 | 40 | import tools.jackson.databind.json.JsonMapper; |
40 | 41 |
|
41 | 42 | import org.springframework.aot.hint.RuntimeHints; |
|
54 | 55 | import org.springframework.jdbc.support.lob.LobCreator; |
55 | 56 | import org.springframework.jdbc.support.lob.LobHandler; |
56 | 57 | import org.springframework.lang.Nullable; |
| 58 | +import org.springframework.security.jackson.SecurityJacksonModules; |
57 | 59 | import org.springframework.security.jackson2.SecurityJackson2Modules; |
58 | 60 | import org.springframework.security.oauth2.core.AuthorizationGrantType; |
59 | 61 | import org.springframework.security.oauth2.core.OAuth2AccessToken; |
@@ -897,11 +899,14 @@ public static class JacksonDelegate implements Mapper { |
897 | 899 | private final JsonMapper jsonMapper; |
898 | 900 |
|
899 | 901 | public JacksonDelegate() { |
900 | | - this.jsonMapper = JsonMapper.builder().addModules(new OAuth2AuthorizationServerJacksonModule()).build(); |
| 902 | + this(JsonMapper.builder()); |
901 | 903 | } |
902 | 904 |
|
903 | 905 | public JacksonDelegate(JsonMapper.Builder builder) { |
904 | | - this.jsonMapper = builder.addModules(new OAuth2AuthorizationServerJacksonModule()).build(); |
| 906 | + List<JacksonModule> modules = SecurityJacksonModules.getModules(getClass().getClassLoader()); |
| 907 | + this.jsonMapper = builder.addModules(modules) |
| 908 | + .addModules(new OAuth2AuthorizationServerJacksonModule()) |
| 909 | + .build(); |
905 | 910 | } |
906 | 911 |
|
907 | 912 | @Override |
|
0 commit comments