Commit e52d3987 authored by Stephane Nicoll's avatar Stephane Nicoll

Adapt to recent changes in Spring Security snapshots

parent 3774af4a
...@@ -90,14 +90,13 @@ class ReactiveOAuth2ResourceServerJwkConfiguration { ...@@ -90,14 +90,13 @@ class ReactiveOAuth2ResourceServerJwkConfiguration {
@Bean @Bean
@ConditionalOnBean(ReactiveJwtDecoder.class) @ConditionalOnBean(ReactiveJwtDecoder.class)
SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http, ReactiveJwtDecoder jwtDecoder) SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http, ReactiveJwtDecoder jwtDecoder) {
throws Exception {
http.authorizeExchange((exchanges) -> exchanges.anyExchange().authenticated()); http.authorizeExchange((exchanges) -> exchanges.anyExchange().authenticated());
http.oauth2ResourceServer((server) -> customDecoder(server, jwtDecoder)); http.oauth2ResourceServer((server) -> customDecoder(server, jwtDecoder));
return http.build(); return http.build();
} }
private void customDecoder(OAuth2ResourceServerSpec server, ReactiveJwtDecoder decoder) throws Exception { private void customDecoder(OAuth2ResourceServerSpec server, ReactiveJwtDecoder decoder) {
server.jwt((jwt) -> jwt.jwtDecoder(decoder)); server.jwt((jwt) -> jwt.jwtDecoder(decoder));
} }
......
...@@ -58,7 +58,7 @@ class ReactiveOAuth2ResourceServerOpaqueTokenConfiguration { ...@@ -58,7 +58,7 @@ class ReactiveOAuth2ResourceServerOpaqueTokenConfiguration {
@Bean @Bean
@ConditionalOnBean(ReactiveOAuth2TokenIntrospectionClient.class) @ConditionalOnBean(ReactiveOAuth2TokenIntrospectionClient.class)
SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) throws Exception { SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
http.authorizeExchange((exchanges) -> exchanges.anyExchange().authenticated()); http.authorizeExchange((exchanges) -> exchanges.anyExchange().authenticated());
http.oauth2ResourceServer(OAuth2ResourceServerSpec::opaqueToken); http.oauth2ResourceServer(OAuth2ResourceServerSpec::opaqueToken);
return http.build(); return http.build();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment