From e11ed2d31375bc93cb8195f87bca6c59ce184f83 Mon Sep 17 00:00:00 2001 From: Siddharth1605 Date: Fri, 29 Dec 2023 19:40:16 +0530 Subject: [PATCH] Updated the Configuration examples in docs Closes gh-14384 --- docs/modules/ROOT/pages/servlet/configuration/java.adoc | 6 +++--- docs/modules/ROOT/pages/servlet/configuration/kotlin.adoc | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/modules/ROOT/pages/servlet/configuration/java.adoc b/docs/modules/ROOT/pages/servlet/configuration/java.adoc index 2baac3708f..39ddb6bae4 100644 --- a/docs/modules/ROOT/pages/servlet/configuration/java.adoc +++ b/docs/modules/ROOT/pages/servlet/configuration/java.adoc @@ -173,7 +173,7 @@ It is configured with the following default implementation: @Bean public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { http - .authorizeRequests(authorize -> authorize + .authorizeHttpRequests(authorize -> authorize .anyRequest().authenticated() ) .formLogin(withDefaults()) @@ -290,7 +290,7 @@ public class MyCustomDsl extends AbstractHttpConfigurer authorize + .authorizeHttpRequests(authorize -> authorize .anyRequest().authenticated() .withObjectPostProcessor(new ObjectPostProcessor() { public O postProcess( diff --git a/docs/modules/ROOT/pages/servlet/configuration/kotlin.adoc b/docs/modules/ROOT/pages/servlet/configuration/kotlin.adoc index 6456903c3a..6efd657cff 100644 --- a/docs/modules/ROOT/pages/servlet/configuration/kotlin.adoc +++ b/docs/modules/ROOT/pages/servlet/configuration/kotlin.adoc @@ -24,7 +24,7 @@ import org.springframework.security.config.annotation.web.invoke @Bean open fun filterChain(http: HttpSecurity): SecurityFilterChain { http { - authorizeRequests { + authorizeHttpRequests { authorize(anyRequest, authenticated) } formLogin { } @@ -81,7 +81,7 @@ class MultiHttpSecurityConfig { open fun apiFilterChain(http: HttpSecurity): SecurityFilterChain { http { securityMatcher("/api/**") <3> - authorizeRequests { + authorizeHttpRequests { authorize(anyRequest, hasRole("ADMIN")) } httpBasic { } @@ -92,7 +92,7 @@ class MultiHttpSecurityConfig { @Bean <4> open fun formLoginFilterChain(http: HttpSecurity): SecurityFilterChain { http { - authorizeRequests { + authorizeHttpRequests { authorize(anyRequest, authenticated) } formLogin { }