From caf7221485a578d2fa3581fbfa74a6afef7587fc Mon Sep 17 00:00:00 2001 From: Madhura Bhave Date: Fri, 24 Aug 2018 12:12:13 -0700 Subject: [PATCH] Update OAuth2 config following changes in Spring Security DSL Closes gh-14169 --- .../ReactiveOAuth2ResourceServerWebSecurityConfiguration.java | 4 ++-- .../servlet/OAuth2ResourceServerWebSecurityConfiguration.java | 4 ++-- .../ReactiveOAuth2ResourceServerAutoConfigurationTests.java | 2 +- spring-boot-project/spring-boot-dependencies/pom.xml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/reactive/ReactiveOAuth2ResourceServerWebSecurityConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/reactive/ReactiveOAuth2ResourceServerWebSecurityConfiguration.java index c481fdeabfe..5b99e00ec07 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/reactive/ReactiveOAuth2ResourceServerWebSecurityConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/reactive/ReactiveOAuth2ResourceServerWebSecurityConfiguration.java @@ -42,8 +42,8 @@ class ReactiveOAuth2ResourceServerWebSecurityConfiguration { @Bean @ConditionalOnMissingBean public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) { - http.authorizeExchange().anyExchange().authenticated().and().oauth2() - .resourceServer().jwt().jwtDecoder(this.jwtDecoder); + http.authorizeExchange().anyExchange().authenticated().and() + .oauth2ResourceServer().jwt().jwtDecoder(this.jwtDecoder); return http.build(); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/servlet/OAuth2ResourceServerWebSecurityConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/servlet/OAuth2ResourceServerWebSecurityConfiguration.java index 14e51b04d2b..7de7d62be1a 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/servlet/OAuth2ResourceServerWebSecurityConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/servlet/OAuth2ResourceServerWebSecurityConfiguration.java @@ -37,8 +37,8 @@ class OAuth2ResourceServerWebSecurityConfiguration { @Override protected void configure(HttpSecurity http) throws Exception { - http.authorizeRequests().anyRequest().authenticated().and().oauth2() - .resourceServer().jwt(); + http.authorizeRequests().anyRequest().authenticated().and() + .oauth2ResourceServer().jwt(); } } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/resource/reactive/ReactiveOAuth2ResourceServerAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/resource/reactive/ReactiveOAuth2ResourceServerAutoConfigurationTests.java index 4b3f1571d80..de7c57dd05d 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/resource/reactive/ReactiveOAuth2ResourceServerAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/resource/reactive/ReactiveOAuth2ResourceServerAutoConfigurationTests.java @@ -146,7 +146,7 @@ public class ReactiveOAuth2ResourceServerAutoConfigurationTests { SecurityWebFilterChain testSpringSecurityFilterChain(ServerHttpSecurity http, ReactiveJwtDecoder decoder) { http.authorizeExchange().pathMatchers("/message/**").hasRole("ADMIN") - .anyExchange().authenticated().and().oauth2().resourceServer().jwt() + .anyExchange().authenticated().and().oauth2ResourceServer().jwt() .jwtDecoder(decoder); return http.build(); } diff --git a/spring-boot-project/spring-boot-dependencies/pom.xml b/spring-boot-project/spring-boot-dependencies/pom.xml index bc414fa526f..8ccaae14073 100644 --- a/spring-boot-project/spring-boot-dependencies/pom.xml +++ b/spring-boot-project/spring-boot-dependencies/pom.xml @@ -166,7 +166,7 @@ 1.2.0.RELEASE 2.0.2.RELEASE 1.2.2.RELEASE - 5.1.0.RC1 + 5.1.0.BUILD-SNAPSHOT Bean-M2 3.0.3.RELEASE 3.23.1