|
|
|
@ -51,8 +51,7 @@ import org.springframework.security.oauth2.jwt.NimbusReactiveJwtDecoder;
|
|
|
|
|
import org.springframework.security.oauth2.jwt.ReactiveJwtDecoder;
|
|
|
|
|
import org.springframework.security.oauth2.server.resource.BearerTokenAuthenticationToken;
|
|
|
|
|
import org.springframework.security.oauth2.server.resource.authentication.JwtReactiveAuthenticationManager;
|
|
|
|
|
import org.springframework.security.oauth2.server.resource.authentication.OAuth2IntrospectionAuthenticationToken;
|
|
|
|
|
import org.springframework.security.oauth2.server.resource.authentication.OAuth2IntrospectionReactiveAuthenticationManager;
|
|
|
|
|
import org.springframework.security.oauth2.server.resource.authentication.OpaqueTokenReactiveAuthenticationManager;
|
|
|
|
|
import org.springframework.security.oauth2.server.resource.introspection.ReactiveOpaqueTokenIntrospector;
|
|
|
|
|
import org.springframework.security.web.server.MatcherSecurityWebFilterChain;
|
|
|
|
|
import org.springframework.security.web.server.SecurityWebFilterChain;
|
|
|
|
@ -285,7 +284,7 @@ class ReactiveOAuth2ResourceServerAutoConfigurationTests {
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
void autoConfigurationWhenIntrospectionUriAvailableShouldBeConditionalOnClass() {
|
|
|
|
|
this.contextRunner.withClassLoader(new FilteredClassLoader(OAuth2IntrospectionAuthenticationToken.class))
|
|
|
|
|
this.contextRunner.withClassLoader(new FilteredClassLoader(BearerTokenAuthenticationToken.class))
|
|
|
|
|
.withPropertyValues(
|
|
|
|
|
"spring.security.oauth2.resourceserver.opaquetoken.introspection-uri=https://check-token.com",
|
|
|
|
|
"spring.security.oauth2.resourceserver.opaquetoken.client-id=my-client-id",
|
|
|
|
@ -369,7 +368,7 @@ class ReactiveOAuth2ResourceServerAutoConfigurationTests {
|
|
|
|
|
ReactiveAuthenticationManagerResolver<?> authenticationManagerResolver = (ReactiveAuthenticationManagerResolver<?>) ReflectionTestUtils
|
|
|
|
|
.getField(webFilter, "authenticationManagerResolver");
|
|
|
|
|
Object authenticationManager = authenticationManagerResolver.resolve(null).block();
|
|
|
|
|
assertThat(authenticationManager).isInstanceOf(OAuth2IntrospectionReactiveAuthenticationManager.class);
|
|
|
|
|
assertThat(authenticationManager).isInstanceOf(OpaqueTokenReactiveAuthenticationManager.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private String cleanIssuerPath(String issuer) {
|
|
|
|
|