Update OAuth2 config following changes in Spring Security DSL
Closes gh-14169
This commit is contained in:
parent
dea67e9aca
commit
caf7221485
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -166,7 +166,7 @@
|
|||
<spring-plugin.version>1.2.0.RELEASE</spring-plugin.version>
|
||||
<spring-restdocs.version>2.0.2.RELEASE</spring-restdocs.version>
|
||||
<spring-retry.version>1.2.2.RELEASE</spring-retry.version>
|
||||
<spring-security.version>5.1.0.RC1</spring-security.version>
|
||||
<spring-security.version>5.1.0.BUILD-SNAPSHOT</spring-security.version>
|
||||
<spring-session-bom.version>Bean-M2</spring-session-bom.version>
|
||||
<spring-ws.version>3.0.3.RELEASE</spring-ws.version>
|
||||
<sqlite-jdbc.version>3.23.1</sqlite-jdbc.version>
|
||||
|
|
Loading…
Reference in New Issue