|
139 | 139 | import org.springframework.security.oauth2.client.authentication.OAuth2LoginAuthenticationToken; |
140 | 140 | import org.springframework.security.oauth2.client.authentication.TestOAuth2AuthenticationTokens; |
141 | 141 | import org.springframework.security.oauth2.client.authentication.TestOAuth2AuthorizationCodeAuthenticationTokens; |
| 142 | +import org.springframework.security.oauth2.client.event.OAuth2AuthorizedClientRefreshedEvent; |
| 143 | +import org.springframework.security.oauth2.client.oidc.authentication.event.OidcUserRefreshedEvent; |
142 | 144 | import org.springframework.security.oauth2.client.oidc.authentication.logout.OidcLogoutToken; |
143 | 145 | import org.springframework.security.oauth2.client.oidc.authentication.logout.TestOidcLogoutTokens; |
144 | 146 | import org.springframework.security.oauth2.client.oidc.session.OidcSessionInformation; |
|
160 | 162 | import org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationExchange; |
161 | 163 | import org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationRequest; |
162 | 164 | import org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationResponse; |
| 165 | +import org.springframework.security.oauth2.core.endpoint.TestOAuth2AccessTokenResponses; |
163 | 166 | import org.springframework.security.oauth2.core.endpoint.TestOAuth2AuthorizationExchanges; |
164 | 167 | import org.springframework.security.oauth2.core.endpoint.TestOAuth2AuthorizationRequests; |
165 | 168 | import org.springframework.security.oauth2.core.endpoint.TestOAuth2AuthorizationResponses; |
|
184 | 187 | import org.springframework.security.oauth2.server.resource.InvalidBearerTokenException; |
185 | 188 | import org.springframework.security.oauth2.server.resource.authentication.BearerTokenAuthentication; |
186 | 189 | import org.springframework.security.oauth2.server.resource.authentication.BearerTokenAuthenticationToken; |
| 190 | +import org.springframework.security.oauth2.server.resource.authentication.DPoPAuthenticationToken; |
187 | 191 | import org.springframework.security.oauth2.server.resource.authentication.JwtAuthenticationToken; |
188 | 192 | import org.springframework.security.oauth2.server.resource.introspection.BadOpaqueTokenException; |
189 | 193 | import org.springframework.security.oauth2.server.resource.introspection.OAuth2IntrospectionAuthenticatedPrincipal; |
@@ -364,6 +368,13 @@ class SpringSecurityCoreVersionSerializableTests { |
364 | 368 | new RuntimeException())); |
365 | 369 | generatorByClassName.put(ClientAuthorizationRequiredException.class, |
366 | 370 | (r) -> new ClientAuthorizationRequiredException("id")); |
| 371 | + generatorByClassName |
| 372 | + .put(OAuth2AuthorizedClientRefreshedEvent.class, (r) -> new OAuth2AuthorizedClientRefreshedEvent( |
| 373 | + TestOAuth2AccessTokenResponses.accessTokenResponse().build(), |
| 374 | + new OAuth2AuthorizedClient(clientRegistration, "principal", TestOAuth2AccessTokens.noScopes()))); |
| 375 | + generatorByClassName.put(OidcUserRefreshedEvent.class, |
| 376 | + (r) -> new OidcUserRefreshedEvent(TestOAuth2AccessTokenResponses.accessTokenResponse().build(), |
| 377 | + TestOidcUsers.create(), TestOidcUsers.create(), authentication)); |
367 | 378 |
|
368 | 379 | // oauth2-jose |
369 | 380 | generatorByClassName.put(BadJwtException.class, (r) -> new BadJwtException("token", new RuntimeException())); |
@@ -411,6 +422,8 @@ class SpringSecurityCoreVersionSerializableTests { |
411 | 422 | (r) -> new BadOpaqueTokenException("message", new RuntimeException())); |
412 | 423 | generatorByClassName.put(OAuth2IntrospectionException.class, |
413 | 424 | (r) -> new OAuth2IntrospectionException("message", new RuntimeException())); |
| 425 | + generatorByClassName.put(DPoPAuthenticationToken.class, |
| 426 | + (r) -> applyDetails(new DPoPAuthenticationToken("token", "proof", "method", "uri"))); |
414 | 427 |
|
415 | 428 | // config |
416 | 429 | generatorByClassName.put(AlreadyBuiltException.class, (r) -> new AlreadyBuiltException("message")); |
|
0 commit comments