Blank
文章6
标签7
分类4
关闭Gateway网关的security验证

关闭Gateway网关的security验证

本篇文章介绍Gateway网关如何关闭登录

Spring Boot版本:2.2.11

1
2
3
4
5
6
7
8
9
10
11
12
@Configuration
@EnableWebFluxSecurity
public class WebSecurityConfig {

@Bean
public SecurityWebFilterChain webFluxSecurityFilterChain(ServerHttpSecurity http) throws Exception {
http.authorizeExchange().anyExchange().permitAll();
http.csrf().disable().httpBasic().disable().logout().disable().formLogin().disable();
return http.build();
}

}

这样再访问网关就不再需要登陆了
转载自:https://blog.csdn.net/menglinjie/article/details/107344589