我试图忽略不需要springsecurity和springwebflux验证的特定路径。这是我的配置:
@Bean
SecurityWebFilterChain springWebFilterChain(ServerHttpSecurity http) throws Exception {
return http.csrf().disable()
.authorizeExchange()
.pathMatchers("/swagger-ui/**").permitAll().and()
.authorizeExchange()
.pathMatchers("/**").authenticated()
.pathMatchers("/prepaid/validateSubscriber").hasAnyRole("VALIDATESUBSCRIBER", "PREPAID")
.pathMatchers("site/crm-services/prepaid/**").hasRole("PREPAID")
.and().httpBasic().and()
.build();
}
但在尝试访问swaggerui时,它仍然要求我进行身份验证,我应该如何配置webfilterchain以忽略swaggerui路径?
暂无答案!
目前还没有任何答案,快来回答吧!