如何解决禁用选定端口的Spring Security [使用WebFlux Security]
如何禁用所选端口的安全性?我需要永久访问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 举报,一经查实,本站将立刻删除。