1

JS CSS files are not loading

I tried below code for allowing js and css file

@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();
  } 

I feel there is problem with Graphiql UI ? Can anyone please help ?

For reference GraphiQL UI for query GraphiQL UI

1 Answers1

2

I used the next matchers to allow rendering graphiQl

.antMatchers("/graphiql", "/vendor/**").permitAll()

GraphiQL version is 5.0.2