【发布时间】:2020-06-30 19:40:05
【问题描述】:
我尝试了下面的代码来允许 js 和 css 文件
@Override
public void configure(WebSecurity web) throws Exception {
web.ignoring().antMatchers("/v2/api-docs",
"/configuration/ui",
"/swagger-resources/**",
"/configuration/security",
"/swagger-ui.html",
"/webjars/**",
"/graphiql",
"/resources/**"
);
}
/*@Override
public void configure(WebSecurity web) throws Exception {
web.ignoring().antMatchers("/resources/**"); // #3
}*/
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests()
.antMatchers("/resources/**").permitAll()
.antMatchers("/*.js").permitAll()
.antMatchers("/*.css").permitAll()
.antMatchers("/*.html").permitAll()
.and().csrf().disable();
}
我觉得 Graphiql UI 有问题? 有人可以帮忙吗?
供参考 GraphiQL UI 进行查询 GraphiQL UI
【问题讨论】:
标签: spring spring-boot graphql spring-security-oauth2 graphiql