Skip to content

Configure WebSecurity using WebSecurityCustomizer #23421

Closed
@eleftherias

Description

@eleftherias

In Spring Security 5.4 we introduced the WebSecurityCustomizer to allow customizing WebSecurity without needing the WebSecurityConfigurerAdapter.

Any customizations to WebSecurity should be done by exposing a WebSecurityCustomizer bean.

@Bean
public WebSecurityCustomizer webSecurityCustomizer() {
	return (web) -> web.ignoring().antMatchers("/ignore1", "/ignore2");
}

See #22739 (comment) for more details around removing the use of WebSecurityConfigurerAdapter.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions