getting unauthorized in swagger code example
Example: spring boot swagger ui 401
@EnableWebSecurity
@Configuration
public class ResourceServerConfig extends WebSecurityConfigurerAdapter {
public static final String[] AUTH_WHITELIST = {
"/swagger-ui.html/**", "/configuration/**", "/swagger-resources/**", "/v2/api-docs", "/webjars/**"
};
@Override
public void configure(WebSecurity web) throws Exception {
web.ignoring().mvcMatchers(HttpMethod.OPTIONS, "/**");
web.ignoring().antMatchers(AUTH_WHITELIST);
}
}