在我们使用Spring 2启动器+Spring5.0.7+反应堆(WebFlux)的项目中,我们希望使用Security实现安全性。只包括初学者:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>而豆子:
@Bean
SecurityWebFilterChain springWebFilterChain(ServerHttpSecurity http) throws Exception {
return http.authorizeExchange()
.anyExchange().authenticated()
.and().build();
}就够了。
但是,我们希望使用JWT令牌(在另一方中生成,在资源服务器中生成)来拦截这些Authorization头。我一直在努力解决这个问题,但是我找不到Spring 5的任何示例(而Spring <5有很多示例和教程)。
有人遇到这个问题了吗?
https://stackoverflow.com/questions/52099813
复制相似问题