addFilterAt
Adds the Filter at the location of the specified Filter class. Variant that is leveraging Kotlin reified type parameters.
Example:
@Configuration
@EnableWebSecurity
class SecurityConfig {
@Bean
fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
http {
addFilterAt<UsernamePasswordAuthenticationFilter>(CustomFilter())
}
return http.build()
}
}Content copied to clipboard
Parameters
filter
the Filter to register
Type Parameters
T
the location of another Filter that is already registered (i.e. known) with Spring Security.
Deprecated
Use 'addFilterAt<T>(filter)' instead.
Adds the Filter at the location of the specified Filter class.
Example:
@Configuration
@EnableWebSecurity
class SecurityConfig {
@Bean
fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
http {
addFilterAt(CustomFilter(), UsernamePasswordAuthenticationFilter::class.java)
}
return http.build()
}
}Content copied to clipboard
Parameters
filter
the Filter to register
atFilter
the location of another Filter that is already registered (i.e. known) with Spring Security.