Skip to content

Commit caf7221

Browse files
committed
Update OAuth2 config following changes in Spring Security DSL
Closes gh-14169
1 parent dea67e9 commit caf7221

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/reactive/ReactiveOAuth2ResourceServerWebSecurityConfiguration.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ class ReactiveOAuth2ResourceServerWebSecurityConfiguration {
4242
@Bean
4343
@ConditionalOnMissingBean
4444
public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
45-
http.authorizeExchange().anyExchange().authenticated().and().oauth2()
46-
.resourceServer().jwt().jwtDecoder(this.jwtDecoder);
45+
http.authorizeExchange().anyExchange().authenticated().and()
46+
.oauth2ResourceServer().jwt().jwtDecoder(this.jwtDecoder);
4747
return http.build();
4848
}
4949

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/servlet/OAuth2ResourceServerWebSecurityConfiguration.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ static class OAuth2WebSecurityConfigurerAdapter extends WebSecurityConfigurerAda
3737

3838
@Override
3939
protected void configure(HttpSecurity http) throws Exception {
40-
http.authorizeRequests().anyRequest().authenticated().and().oauth2()
41-
.resourceServer().jwt();
40+
http.authorizeRequests().anyRequest().authenticated().and()
41+
.oauth2ResourceServer().jwt();
4242
}
4343

4444
}

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/resource/reactive/ReactiveOAuth2ResourceServerAutoConfigurationTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ static class SecurityWebFilterChainConfig {
146146
SecurityWebFilterChain testSpringSecurityFilterChain(ServerHttpSecurity http,
147147
ReactiveJwtDecoder decoder) {
148148
http.authorizeExchange().pathMatchers("/message/**").hasRole("ADMIN")
149-
.anyExchange().authenticated().and().oauth2().resourceServer().jwt()
149+
.anyExchange().authenticated().and().oauth2ResourceServer().jwt()
150150
.jwtDecoder(decoder);
151151
return http.build();
152152
}

spring-boot-project/spring-boot-dependencies/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@
166166
<spring-plugin.version>1.2.0.RELEASE</spring-plugin.version>
167167
<spring-restdocs.version>2.0.2.RELEASE</spring-restdocs.version>
168168
<spring-retry.version>1.2.2.RELEASE</spring-retry.version>
169-
<spring-security.version>5.1.0.RC1</spring-security.version>
169+
<spring-security.version>5.1.0.BUILD-SNAPSHOT</spring-security.version>
170170
<spring-session-bom.version>Bean-M2</spring-session-bom.version>
171171
<spring-ws.version>3.0.3.RELEASE</spring-ws.version>
172172
<sqlite-jdbc.version>3.23.1</sqlite-jdbc.version>

0 commit comments

Comments
 (0)