Update OAuth2 config following changes in Spring Security DSL

Closes gh-14169
This commit is contained in:
Madhura Bhave
2018-08-24 12:12:13 -07:00
parent dea67e9aca
commit caf7221485
4 changed files with 6 additions and 6 deletions

View File

@@ -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();
}

View File

@@ -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();
}
}

View File

@@ -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();
}