authorizeExchange

fun authorizeExchange(authorizeExchangeConfiguration: AuthorizeExchangeDsl.() -> Unit)

Allows restricting access based upon the ServerWebExchange

Example:

@Configuration
@EnableWebFluxSecurity
class SecurityConfig {

@Bean
fun springWebFilterChain(http: ServerHttpSecurity): SecurityWebFilterChain {
return http {
authorizeExchange {
authorize("/public", permitAll)
authorize(anyExchange, authenticated)
}
}
}
}

Parameters

authorizeExchangeConfiguration

custom configuration that specifies access for an exchange

See also