Skip to content

Commit 614a67b

Browse files
committed
fix(core): add missing spring security serialization hints
1 parent cbe717b commit 614a67b

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

spring-session-core/src/main/java/org/springframework/session/aot/hint/CommonSessionSecurityRuntimeHints.java

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,35 @@ private void registerOAuth2ResourceServerHintsIfNeeded(RuntimeHints hints) {
7575

7676
private void registerOAuth2ClientHintsIfNeeded(RuntimeHints hints) {
7777
Arrays.asList(
78+
TypeReference.of("org.springframework.security.oauth2.core.AbstractOAuth2Token"),
79+
TypeReference.of("org.springframework.security.oauth2.core.OAuth2AccessToken"),
80+
TypeReference.of("org.springframework.security.oauth2.core.OAuth2AccessToken$TokenType"),
81+
TypeReference.of("org.springframework.security.oauth2.core.AuthenticationMethod"),
82+
TypeReference.of("org.springframework.security.oauth2.core.ClientAuthenticationMethod"),
83+
TypeReference.of("org.springframework.security.oauth2.core.AuthorizationGrantType"),
84+
TypeReference.of("org.springframework.security.oauth2.core.OAuth2RefreshToken"),
85+
TypeReference.of("org.springframework.security.oauth2.core.OAuth2AuthenticationException"),
86+
TypeReference.of("org.springframework.security.oauth2.core.user.OAuth2UserAuthority"),
87+
TypeReference.of("org.springframework.security.oauth2.core.user.DefaultOAuth2User"),
88+
TypeReference.of("org.springframework.security.oauth2.core.oidc.user.OidcUserAuthority"),
89+
TypeReference.of("org.springframework.security.oauth2.core.oidc.user.DefaultOidcUser"),
90+
TypeReference.of("org.springframework.security.oauth2.core.oidc.OidcIdToken"),
91+
TypeReference.of("org.springframework.security.oauth2.core.oidc.OidcUserInfo"),
92+
TypeReference.of("org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationRequest"),
93+
TypeReference.of("org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationResponseType"),
7894
TypeReference.of("org.springframework.security.oauth2.client.authentication.OAuth2AuthenticationToken"),
95+
TypeReference.of("org.springframework.security.oauth2.client.OAuth2AuthorizedClient"),
7996
TypeReference
8097
.of("org.springframework.security.oauth2.client.authentication.OAuth2LoginAuthenticationToken"),
8198
TypeReference
82-
.of("org.springframework.security.oauth2.client.authentication.OAuth2AuthorizationCodeAuthenticationToken"),
83-
TypeReference.of("org.springframework.security.oauth2.core.OAuth2AuthenticationException"))
99+
.of("org.springframework.security.oauth2.client.authentication.OAuth2AuthorizationCodeAuthenticationToken"),
100+
TypeReference.of("org.springframework.security.oauth2.client.registration.ClientRegistration"),
101+
TypeReference
102+
.of("org.springframework.security.oauth2.client.registration.ClientRegistration$ProviderDetails"),
103+
TypeReference
104+
.of("org.springframework.security.oauth2.client.registration.ClientRegistration$ProviderDetails$UserInfoEndpoint"),
105+
TypeReference.of("net.minidev.json.JSONObject"),
106+
TypeReference.of("com.nimbusds.oauth2.sdk.util.OrderedJSONObject"))
84107
.forEach((type) -> hints.serialization()
85108
.registerType(type, (hint) -> hint.onReachableType(TypeReference
86109
.of("org.springframework.security.oauth2.client.authentication.OAuth2AuthenticationToken"))));

0 commit comments

Comments
 (0)