Spring Cloud Gateway: An expected CSRF token cannot be found

Spring Cloud Gateway: An expected CSRF token cannot be found

Spike Zhang

An expected CSRF token cannot be found

因为mvc和gateway冲突,而配置了:spring.main.web-application-type=reactive

1
2
3
4
5
@Bean
public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
http.csrf(ServerHttpSecurity.CsrfSpec::disable);
return http.build();
}
  • 标题: Spring Cloud Gateway: An expected CSRF token cannot be found
  • 作者: Spike Zhang
  • 创建于 : 2024-07-06 11:15:24
  • 更新于 : 2024-07-13 09:46:17
  • 链接: https://chaosbynn.github.io/2024/07/06/Spring-Cloud-Gateway-An-expected-CSRF-token-cannot-be-found/
  • 版权声明: 本文章采用 CC BY-NC-SA 4.0 进行许可。
评论
目录
Spring Cloud Gateway: An expected CSRF token cannot be found