October 2018
Intermediate to advanced
556 pages
15h 18m
English
The last part that we haven't yet covered is how complex it is to enable security in a reactive web application. Fortunately, the configuration of security in a modern WebFlux-based application requires the declaration of few beans. The following is a reference example of how we may do this:
@SpringBootConfiguration // (1)@EnableReactiveMethodSecurity // (1.1)public class SecurityConfiguration { // @Bean // (2) public SecurityWebFilterChain securityWebFilterChain( // ServerHttpSecurity http // (2.1) ) { // return http // (2.2) .formLogin() // .and() // .authorizeExchange() // .anyExchange().authenticated() // .and() // .build(); // (2.3) } // @Bean // (3) public ReactiveUserDetailsService userDetailsService() { ...
Read now
Unlock full access