csrf

fun csrf(csrfConfiguration: ServerCsrfDsl.() -> Unit)

Enables CSRF protection.

Example:

@Configuration
@EnableWebFluxSecurity
class SecurityConfig {

@Bean
fun springWebFilterChain(http: ServerHttpSecurity): SecurityWebFilterChain {
return http {
csrf { }
}
}
}

Parameters

csrfConfiguration

custom configuration to apply to the CSRF protection

See also