http.authorizeRequests() //allow anonymous access to /user/login endpoint .antMatchers("/api/v1/login").permitAll() .antMatchers("/swagger*//**").permitAll() .antMatchers("/v2/api-docs",//swagger api json "/swagger-resources/configuration/ui",//用来获取支持的动作 "/swagger-resources",//用来获取api-docs的URL "/swagger-resources/configuration/security",//安全选择 "/swagger-ui.html" ).permitAll() // authenticate all other requests .anyRequest().authenticated();
Security配置swagger
最新推荐文章于 2024-08-05 15:14:54 发布