From c8102de709b533180ffad703a5b118bd81355528 Mon Sep 17 00:00:00 2001 From: Ivan Hargreaves Date: Thu, 19 Nov 2026 18:15:33 +0000 Subject: [PATCH] Replace deprecated AntPathRequestMatcher with string CSRF matcher Spring Security 6.5 deprecates AntPathRequestMatcher for removal, which Eclipse reports as '[removal] AntPathRequestMatcher ... has been deprecated'. The ignoringRequestMatchers String overload matches the same path and is what the springboot/v4 branch uses. Behaviour is unchanged. --- .../java/com/ibm/cicsdev/springboot/security/Application.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cics-java-liberty-springboot-security-app/src/main/java/com/ibm/cicsdev/springboot/security/Application.java b/cics-java-liberty-springboot-security-app/src/main/java/com/ibm/cicsdev/springboot/security/Application.java index 77e2beb..d405c72 100644 --- a/cics-java-liberty-springboot-security-app/src/main/java/com/ibm/cicsdev/springboot/security/Application.java +++ b/cics-java-liberty-springboot-security-app/src/main/java/com/ibm/cicsdev/springboot/security/Application.java @@ -18,7 +18,6 @@ import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.web.SecurityFilterChain; -import org.springframework.security.web.util.matcher.AntPathRequestMatcher; import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; @@ -61,7 +60,7 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception // Java EE form authentication, not by Spring Security, so no CSRF token is // available in the form POST. All other endpoints retain CSRF protection. .csrf(csrf -> csrf - .ignoringRequestMatchers(new AntPathRequestMatcher("/j_security_check")) + .ignoringRequestMatchers("/j_security_check") ) .jee(jee -> jee.mappableRoles("USER", "ADMIN"));