addFilterAt

fun addFilterAt(webFilter: WebFilter, order: SecurityWebFiltersOrder)

Adds a WebFilter at a specific position.

Example:

@Configuration
@EnableWebFluxSecurity
class SecurityConfig {

@Bean
fun springWebFilterChain(http: ServerHttpSecurity): SecurityWebFilterChain {
return http {
addFilterAt(CustomWebFilter(), SecurityWebFiltersOrder.SECURITY_CONTEXT_SERVER_WEB_EXCHANGE)
}
}
}

Parameters

webFilter

the WebFilter to add

order

the place to insert the WebFilter