Skip to content

Configure WebSecurity without WebSecurityConfigurerAdapter #8978

Closed

Description

@eleftherias

Expected Behavior

We should be able to configure WebSecurity without needing WebSecurityConfigurerAdapter.

The approach is to create a customizer for WebSecurity and expose that as a bean.

Current Behavior

The WebSecurityConfigurerAdapter has the ability to customize WebSecurity.
Here is an example:

@Configuration
static class WebConfigurer extends WebSecurityConfigurerAdapter {
	@Override
	public void configure(WebSecurity web) {
		web
			.ignoring()
				.antMatchers("/ignore1", "/ignore2");
	}
}

Related: gh-8804

Activity

  1. added
    in: web
    type: enhancement
    on Aug 21, 2020
  2. self-assigned this
    on Aug 21, 2020
  3. added a commit that references this issue on Sep 7, 2020
    7ecd1d3
  4. added a commit that references this issue on Sep 9, 2020
    4e2a050
  5. eleftherias commented on Sep 21, 2020

    @eleftherias
    ContributorAuthor

    WebSecurity can now be configured by exposing a WebSecurityCustomizer bean.

    @Bean
    public WebSecurityCustomizer webSecurityCustomizer() {
    	return (web) -> web.ignoring().antMatchers("/ignore1", "/ignore2");
    }
    
  6. added this to the 5.4.0 milestone on Sep 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

in: webtype: enhancement

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions