diff --git a/config/src/main/java/org/springframework/security/config/annotation/web/configuration/WebSecurityConfigurerAdapter.java b/config/src/main/java/org/springframework/security/config/annotation/web/configuration/WebSecurityConfigurerAdapter.java index 597edc90a21..afdcd3e15e0 100644 --- a/config/src/main/java/org/springframework/security/config/annotation/web/configuration/WebSecurityConfigurerAdapter.java +++ b/config/src/main/java/org/springframework/security/config/annotation/web/configuration/WebSecurityConfigurerAdapter.java @@ -330,6 +330,15 @@ public void init(final WebSecurity web) throws Exception { /** * Override this method to configure {@link WebSecurity}. For example, if you wish to * ignore certain requests. + * + * Endpoint used in this method ignores the + * spring security filters, headers, csrf etc. see + * {@link org.springframework.security.config.annotation.web.configurers.HeadersConfigurer} and + * {@link org.springframework.security.config.annotation.web.configurers.CsrfConfigurer } + * + * Instead, if you want to protect public endpoints against common vulnerabilities, then see + * {@link #configure(HttpSecurity)} and the {@link HttpSecurity#authorizeRequests} + * configuration method. */ public void configure(WebSecurity web) throws Exception { } @@ -343,6 +352,10 @@ public void configure(WebSecurity web) throws Exception { * http.authorizeRequests().anyRequest().authenticated().and().formLogin().and().httpBasic(); * * + * Public endpoints that require defense against common vulnerabilities can be specified here. + * See {@link HttpSecurity#authorizeRequests} and the `permitAll()` authorization rule + * for more details. + * * @param http the {@link HttpSecurity} to modify * @throws Exception if an error occurs */