Reputation: 1
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
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:
If you do not WebSecurityConfigurerAdapter
bean , SpringBootWebSecurityConfiguration will create one for you.
WebSecurityEnablerConfiguration will make sure @EnableWebSecurity
is always present.
@EnableWebSecurity
will import the spring security default configuration (WebSecurityConfiguration
) which define the famous springSecurityFilterChain bean.
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