0

I have this code:

@EnableWebSecurity
@Configuration
class WebSecurityConfig extends WebSecurityConfigurerAdapter {

  @Override
  protected void configure(HttpSecurity http) throws Exception {
    http
      .csrf()
      .disable()
      .addFilterAfter(new JWTAuthorizationFilter(), UsernamePasswordAuthenticationFilter.class)
      .sessionManagement()
         .sessionCreationPolicy(SessionCreationPolicy.STATELESS)
      .and()
      .authorizeRequests()
      .antMatchers(HttpMethod.POST, "/auth/login").permitAll()
      .anyRequest().authenticated();
  }
}

I have tried to insert the following in various places:

      .antMatchers("/", "/public/**", "/resources/**", "/resources/public/**").permitAll()

but with not success.

I have the following REST endpoints registered:

  • /auth/login
  • /**

The last one (/**) should take anything but the static files.

KimHansen
  • 375
  • 2
  • 12

0 Answers0