spring security 在 spring webflux 中的使用
spring5增加了reactive web模块,相应的在spring security中也增加了 [webflux-web-security] 模块,相对于spring security 在配置和使用方面有略微的差异,下面主要说明简单的配置和自定义用户信息的配置。
1、基本配置
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.reactive.EnableWebFluxSecurity;
import org.springframework.security.config.web.server.ServerHttpSecurity;
import org.springframework.security.web.server.SecurityWebFilterChain;
@Configuration
@EnableWebFluxSecurity
public class WebFluxSecurityConfig{
@Bean
public SecurityWebFilterChain