|
@@ -1395,10 +1395,9 @@ public class OAuth2ResourceServerConfigurerTests {
|
|
|
context.registerBean("converterOne", JwtAuthenticationConverter.class, () -> converterBean);
|
|
|
context.registerBean("converterTwo", JwtAuthenticationConverter.class, () -> converterBean);
|
|
|
this.spring.context(context).autowire();
|
|
|
- new OAuth2ResourceServerConfigurer<HttpSecurity>(context).jwt((jwt) -> {
|
|
|
- assertThatExceptionOfType(NoUniqueBeanDefinitionException.class)
|
|
|
- .isThrownBy(jwt::getJwtAuthenticationConverter);
|
|
|
- });
|
|
|
+ new OAuth2ResourceServerConfigurer<HttpSecurity>(context)
|
|
|
+ .jwt((jwt) -> assertThatExceptionOfType(NoUniqueBeanDefinitionException.class)
|
|
|
+ .isThrownBy(jwt::getJwtAuthenticationConverter));
|
|
|
}
|
|
|
|
|
|
@Test
|
|
@@ -1577,8 +1576,7 @@ public class OAuth2ResourceServerConfigurerTests {
|
|
|
SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
|
|
|
// @formatter:off
|
|
|
http
|
|
|
- .authorizeRequests((authorizeRequests) ->
|
|
|
- authorizeRequests
|
|
|
+ .authorizeRequests((authorize) -> authorize
|
|
|
.requestMatchers("/requires-read-scope").access("hasAuthority('SCOPE_message:read')")
|
|
|
.anyRequest().authenticated()
|
|
|
)
|
|
@@ -1630,8 +1628,7 @@ public class OAuth2ResourceServerConfigurerTests {
|
|
|
SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
|
|
|
// @formatter:off
|
|
|
http
|
|
|
- .authorizeRequests((authorizeRequests) ->
|
|
|
- authorizeRequests
|
|
|
+ .authorizeRequests((authorize) -> authorize
|
|
|
.requestMatchers("/requires-read-scope").access("hasAuthority('SCOPE_message:read')")
|
|
|
.anyRequest().authenticated()
|
|
|
)
|
|
@@ -2122,8 +2119,7 @@ public class OAuth2ResourceServerConfigurerTests {
|
|
|
SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
|
|
|
// @formatter:off
|
|
|
http
|
|
|
- .authorizeRequests((authorizeRequests) ->
|
|
|
- authorizeRequests
|
|
|
+ .authorizeRequests((authorize) -> authorize
|
|
|
.anyRequest().authenticated()
|
|
|
)
|
|
|
.oauth2ResourceServer((oauth2ResourceServer) ->
|
|
@@ -2386,8 +2382,7 @@ public class OAuth2ResourceServerConfigurerTests {
|
|
|
SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
|
|
|
// @formatter:off
|
|
|
http
|
|
|
- .authorizeRequests((authorizeRequests) ->
|
|
|
- authorizeRequests
|
|
|
+ .authorizeRequests((authorize) -> authorize
|
|
|
.requestMatchers("/requires-read-scope").hasAuthority("SCOPE_message:read")
|
|
|
.anyRequest().authenticated()
|
|
|
)
|
|
@@ -2433,8 +2428,7 @@ public class OAuth2ResourceServerConfigurerTests {
|
|
|
SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
|
|
|
// @formatter:off
|
|
|
http
|
|
|
- .authorizeRequests((authorizeRequests) ->
|
|
|
- authorizeRequests
|
|
|
+ .authorizeRequests((authorize) -> authorize
|
|
|
.anyRequest().authenticated()
|
|
|
)
|
|
|
.oauth2ResourceServer((oauth2ResourceServer) ->
|