首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >graphiQL是否支持spring security?添加spring安全性后,graphiQL UI无法正常工作

graphiQL是否支持spring security?添加spring安全性后,graphiQL UI无法正常工作
EN

Stack Overflow用户
提问于 2019-09-11 15:02:00
回答 1查看 255关注 0票数 1

JS CSS files are not loading

我尝试了下面的代码来允许js和css文件。

代码语言:javascript
复制
@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有问题?有人能帮帮忙吗?

对于query GraphiQL UI的参考GraphiQL UI

EN

回答 1

Stack Overflow用户

发布于 2020-06-30 19:40:06

我使用了下一个匹配器来渲染graphiQl

代码语言:javascript
复制
.antMatchers("/graphiql", "/vendor/**").permitAll()

GraphiQL版本为5.0.2

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/57883739

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档