Raj R
Raj R

Reputation: 1

WebSecurityConfigurerAdapter and AbstractSecurityWebApplicationInitializer absent

In most demos I have seen
1) WebSecurityConfigurerAdapter (For configuration)

2)AbstractSecurityWebApplicationInitializer (For initialising the SECURITY FILTERS )

In my project at work we are also using SPRING SECURITY,but i couldn't any of the above mentioned classes.

So how in my project we are initializing Spring Security filters and configuring it?

In my project we are implementing/extending the following interfaces/classes

My application uses SPRING BOOT

a) AuthenticationProvider

b) Authentication

c) Filter

Upvotes: 0

Views: 674

Answers (1)

Ken Chan
Ken Chan

Reputation: 90447

So how in my project we are initializing Spring Security filters and configuring it?

They are defined by the spring boot 's auto configuration. The overall workflow is:

  1. If you do not WebSecurityConfigurerAdapter bean , SpringBootWebSecurityConfiguration will create one for you.

  2. WebSecurityEnablerConfiguration will make sure @EnableWebSecurity is always present.

  3. @EnableWebSecurity will import the spring security default configuration (WebSecurityConfiguration) which define the famous springSecurityFilterChain bean.

  4. SecurityFilterAutoConfiguration will register springSecurityFilterChain to the embeddable server. (Through by defining a FilterRegistrationBean (see docs)). This is equivalent to what AbstractSecurityWebApplicationInitializer does but in the spring-boot embeddable server way.

Upvotes: 1

Related Questions