Update OAuth2 config following changes in Spring Security DSL

Closes gh-14169
pull/14156/merge
Madhura Bhave 6 years ago
parent dea67e9aca
commit caf7221485

@ -42,8 +42,8 @@ class ReactiveOAuth2ResourceServerWebSecurityConfiguration {
@Bean @Bean
@ConditionalOnMissingBean @ConditionalOnMissingBean
public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) { public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
http.authorizeExchange().anyExchange().authenticated().and().oauth2() http.authorizeExchange().anyExchange().authenticated().and()
.resourceServer().jwt().jwtDecoder(this.jwtDecoder); .oauth2ResourceServer().jwt().jwtDecoder(this.jwtDecoder);
return http.build(); return http.build();
} }

@ -37,8 +37,8 @@ class OAuth2ResourceServerWebSecurityConfiguration {
@Override @Override
protected void configure(HttpSecurity http) throws Exception { protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests().anyRequest().authenticated().and().oauth2() http.authorizeRequests().anyRequest().authenticated().and()
.resourceServer().jwt(); .oauth2ResourceServer().jwt();
} }
} }

@ -146,7 +146,7 @@ public class ReactiveOAuth2ResourceServerAutoConfigurationTests {
SecurityWebFilterChain testSpringSecurityFilterChain(ServerHttpSecurity http, SecurityWebFilterChain testSpringSecurityFilterChain(ServerHttpSecurity http,
ReactiveJwtDecoder decoder) { ReactiveJwtDecoder decoder) {
http.authorizeExchange().pathMatchers("/message/**").hasRole("ADMIN") http.authorizeExchange().pathMatchers("/message/**").hasRole("ADMIN")
.anyExchange().authenticated().and().oauth2().resourceServer().jwt() .anyExchange().authenticated().and().oauth2ResourceServer().jwt()
.jwtDecoder(decoder); .jwtDecoder(decoder);
return http.build(); return http.build();
} }

@ -166,7 +166,7 @@
<spring-plugin.version>1.2.0.RELEASE</spring-plugin.version> <spring-plugin.version>1.2.0.RELEASE</spring-plugin.version>
<spring-restdocs.version>2.0.2.RELEASE</spring-restdocs.version> <spring-restdocs.version>2.0.2.RELEASE</spring-restdocs.version>
<spring-retry.version>1.2.2.RELEASE</spring-retry.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-session-bom.version>Bean-M2</spring-session-bom.version>
<spring-ws.version>3.0.3.RELEASE</spring-ws.version> <spring-ws.version>3.0.3.RELEASE</spring-ws.version>
<sqlite-jdbc.version>3.23.1</sqlite-jdbc.version> <sqlite-jdbc.version>3.23.1</sqlite-jdbc.version>

Loading…
Cancel
Save