Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/345.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 禁用选定端口的Spring安全性[使用WebFlux安全性]_Java_Spring_Spring Security_Spring Webflux - Fatal编程技术网

Java 禁用选定端口的Spring安全性[使用WebFlux安全性]

Java 禁用选定端口的Spring安全性[使用WebFlux安全性],java,spring,spring-security,spring-webflux,Java,Spring,Spring Security,Spring Webflux,如何禁用所选端口的安全性?我需要给予永久访问,例如4200端口(角度)。我在WebFlux安全部门工作 @EnableWebFluxSecurity @EnableReactiveMethodSecurity public class SecurityConfig { (...) int selectedPort = 4200; @Bean public SecurityWebFilterChain springSecurityFilterChain(final ServerHt

如何禁用所选端口的安全性?我需要给予永久访问,例如4200端口(角度)。我在WebFlux安全部门工作

@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();
  } 

不要在不同的端口上为应用程序提供服务,创建一个端点,将index.html与应用程序的其余部分在同一端口上提供服务。这可能会有所帮助。白名单本地:4200不要在不同的端口上为应用程序提供服务,创建一个端点,该端点将在与应用程序其余部分相同的端口上为index.html提供服务。这可能会有所帮助。本地白名单:4200