securityMatcher

fun securityMatcher(securityMatcher: ServerWebExchangeMatcher)

Allows configuring the ServerHttpSecurity to only be invoked when matching the provided ServerWebExchangeMatcher.

Example:

@Configuration
@EnableWebFluxSecurity
class SecurityConfig {

@Bean
fun springWebFilterChain(http: ServerHttpSecurity): SecurityWebFilterChain {
return http {
securityMatcher(PathPatternParserServerWebExchangeMatcher("/api/**"))
formLogin {
loginPage = "/log-in"
}
}
}
}

Parameters

securityMatcher

a ServerWebExchangeMatcher used to determine whether this configuration should be invoked.