我在Spring Cloud Gateway中使用了Spring Security。云版本是Finchely.SR2,Spring Boot版本是2.0.x。
然后我像这样在一个匹配器中设置了两个角色:
.pathMatchers("/apis/**").hasRole("TEST1")
.pathMatchers("/apis/**").hasRole("TEST2")
但是,当我启动应用程序并进行测试时,只有TEST1角色可以访问。 TEST2角色会收到403禁止响应。
我知道在spring-boot-starter-web与spring-security中,它有类似的方法
.antMatchers("/apis/**").hasAnyRole("TEST1", "TEST2")
Webflux Spring Security有没有像hasAnyRole(String...roles)这样的API可以使用?