问题描述
如何禁用所选端口的安全性?我需要永久访问4200端口(角度)。我使用WebFlux Security。
@EnableWebFluxSecurity
@EnableReactiveMethodSecurity
public class SecurityConfig {
(...)
int selectedPort = 4200;
@Bean
public SecurityWebFilterChain springSecurityFilterChain(final ServerHttpSecurity http) {
return http
(...)
.authorizeExchange()
.pathMatchers("/menage").authenticated()
.anyExchange().permitAll()
.and()
.build();
}
在此示例中,我需要授予永久访问权限(禁用安全性?),以使端口4200可以使用“ / menage”路径。
这种方法当然行不通:
private RequestMatcher checkPort(final int port) {
return (HttpServletRequest request) -> port == request.getLocalPort();
}
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)