addFilterAfter

fun addFilterAfter(webFilter: WebFilter, order: SecurityWebFiltersOrder)

Adds a WebFilter after specific position.

Example:

@Configuration
@EnableWebFluxSecurity
class SecurityConfig {

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

Parameters

webFilter

the WebFilter to add

order

the place after which to insert the WebFilter