From 50da5b6498e01debae40af5020ff2a53890491c6 Mon Sep 17 00:00:00 2001 From: Marc Becker Date: Fri, 25 Nov 2022 13:35:48 +0100 Subject: [PATCH] Fix securityMatchers code sample Closes gh-12296 --- docs/modules/ROOT/pages/migration/servlet/config.adoc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/modules/ROOT/pages/migration/servlet/config.adoc b/docs/modules/ROOT/pages/migration/servlet/config.adoc index 83e8178a2f..b7b58a7120 100644 --- a/docs/modules/ROOT/pages/migration/servlet/config.adoc +++ b/docs/modules/ROOT/pages/migration/servlet/config.adoc @@ -409,7 +409,9 @@ import static org.springframework.security.web.util.matcher.AntPathRequestMatche @Bean public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { http - .securityMatcher(antMatcher("/api/**"), antMatcher("/app/**")) + .securityMatchers((matchers) -> matchers + .requestMatchers(antMatcher("/api/**"), antMatcher("/app/**")) + ) .authorizeHttpRequests((authz) -> authz .requestMatchers(antMatcher("/api/admin/**")).hasRole("ADMIN") .anyRequest().authenticated()