From 8af3b5afe4f1f0e2fd7f0a0e4c33c9086f76f015 Mon Sep 17 00:00:00 2001 From: Johannes Graf Date: Tue, 8 Nov 2022 12:10:06 +0100 Subject: [PATCH] Fix documentation part of Multiple HttpSecurity Instances `http.antMatcher()` is not longer available and was replaced with `http.securityMatcher()`, so use this in the Java Config Multiple HttpSecurity Instances example, too --- docs/modules/ROOT/pages/servlet/configuration/java.adoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/modules/ROOT/pages/servlet/configuration/java.adoc b/docs/modules/ROOT/pages/servlet/configuration/java.adoc index d7e18d013f..d3537bbfa5 100644 --- a/docs/modules/ROOT/pages/servlet/configuration/java.adoc +++ b/docs/modules/ROOT/pages/servlet/configuration/java.adoc @@ -209,7 +209,7 @@ public class MultiHttpSecurityConfig { @Order(1) <2> public SecurityFilterChain apiFilterChain(HttpSecurity http) throws Exception { http - .antMatcher("/api/**") <3> + .securityMatcher("/api/**") <3> .authorizeHttpRequests(authorize -> authorize .anyRequest().hasRole("ADMIN") ) @@ -230,7 +230,7 @@ public class MultiHttpSecurityConfig { ---- <1> Configure Authentication as usual. <2> Create an instance of `SecurityFilterChain` that contains `@Order` to specify which `SecurityFilterChain` should be considered first. -<3> The `http.antMatcher` states that this `HttpSecurity` is applicable only to URLs that start with `/api/`. +<3> The `http.securityMatcher` states that this `HttpSecurity` is applicable only to URLs that start with `/api/`. <4> Create another instance of `SecurityFilterChain`. If the URL does not start with `/api/`, this configuration is used. This configuration is considered after `apiFilterChain`, since it has an `@Order` value after `1` (no `@Order` defaults to last).