Skip to content

-gh 8784 Document improvement for WebSecurityConfigure #8825

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
}
Expand All @@ -343,6 +352,10 @@ public void configure(WebSecurity web) throws Exception {
* http.authorizeRequests().anyRequest().authenticated().and().formLogin().and().httpBasic();
* </pre>
*
* 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
*/
Expand Down