|
|
|
@ -58,7 +58,7 @@ public class ReactiveOAuth2ResourceServerAutoConfigurationTests {
|
|
|
|
|
@Test
|
|
|
|
|
public void autoConfigurationShouldConfigureResourceServer() {
|
|
|
|
|
this.contextRunner.withPropertyValues(
|
|
|
|
|
"spring.security.oauth2.resource.jwt.jwk.set-uri=http://jwk-set-uri.com")
|
|
|
|
|
"spring.security.oauth2.resourceserver.jwt.jwk-set-uri=http://jwk-set-uri.com")
|
|
|
|
|
.run((context) -> {
|
|
|
|
|
assertThat(context.getBean(ReactiveJwtDecoder.class))
|
|
|
|
|
.isInstanceOf(NimbusReactiveJwtDecoder.class);
|
|
|
|
@ -75,7 +75,7 @@ public class ReactiveOAuth2ResourceServerAutoConfigurationTests {
|
|
|
|
|
@Test
|
|
|
|
|
public void jwtDecoderBeanIsConditionalOnMissingBean() {
|
|
|
|
|
this.contextRunner.withPropertyValues(
|
|
|
|
|
"spring.security.oauth2.resource.jwt.jwk.set-uri=http://jwk-set-uri.com")
|
|
|
|
|
"spring.security.oauth2.resourceserver.jwt.jwk-set-uri=http://jwk-set-uri.com")
|
|
|
|
|
.withUserConfiguration(JwtDecoderConfig.class)
|
|
|
|
|
.run((this::assertFilterConfiguredWithJwtAuthenticationManager));
|
|
|
|
|
}
|
|
|
|
@ -83,7 +83,7 @@ public class ReactiveOAuth2ResourceServerAutoConfigurationTests {
|
|
|
|
|
@Test
|
|
|
|
|
public void autoConfigurationShouldBeConditionalOnBearerTokenAuthenticationTokenClass() {
|
|
|
|
|
this.contextRunner.withPropertyValues(
|
|
|
|
|
"spring.security.oauth2.resource.jwt.jwk.set-uri=http://jwk-set-uri.com")
|
|
|
|
|
"spring.security.oauth2.resourceserver.jwt.jwk-set-uri=http://jwk-set-uri.com")
|
|
|
|
|
.withUserConfiguration(JwtDecoderConfig.class)
|
|
|
|
|
.withClassLoader(
|
|
|
|
|
new FilteredClassLoader(BearerTokenAuthenticationToken.class))
|
|
|
|
@ -94,7 +94,7 @@ public class ReactiveOAuth2ResourceServerAutoConfigurationTests {
|
|
|
|
|
@Test
|
|
|
|
|
public void autoConfigurationWhenSecurityWebFilterChainConfigPresentShouldNotAddOne() {
|
|
|
|
|
this.contextRunner.withPropertyValues(
|
|
|
|
|
"spring.security.oauth2.resource.jwt.jwk.set-uri=http://jwk-set-uri.com")
|
|
|
|
|
"spring.security.oauth2.resourceserver.jwt.jwk-set-uri=http://jwk-set-uri.com")
|
|
|
|
|
.withUserConfiguration(SecurityWebFilterChainConfig.class)
|
|
|
|
|
.run((context) -> {
|
|
|
|
|
assertThat(context).hasSingleBean(SecurityWebFilterChain.class);
|
|
|
|
|