Spring security authorizeExchange and authorizeRequests difference

Viewed 279

when use spring security web, we can use the antMathcers

http.authorizeRequests()
    .antMatchers("/admin/**")

when use webflux, we use

http.authorizeExchange(exchanges->
                        exchanges
                                .pathMatchers("/admin/**")
                                .permitAll()
                                .anyExchange()
                                .authenticated()
)

the problem is, the first way we can has the ant patterns like "/admin/**/test"

but the second way, the above method will get wrong.

How can I achieve th above uri pattherns in the webflux environment?

1 Answers
Related