I have a webSecConfig class that extends WebSecurityConfigurerAdapter. I paste it's method where I tried to allow access with using .antMatchers. My folder structure: ... -resources --static (here I have images for the html/css) --templates ---login.html ---design.css I have tried adding a "public" folder based on some comments, but nothing seems to work so far. Can anyone help me with this please?
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.formLogin()
.loginPage("/login").permitAll()
.loginProcessingUrl("/login")
.defaultSuccessUrl("/messages", true)
.and()
.logout()
.logoutSuccessUrl("/login")
.logoutRequestMatcher(new AntPathRequestMatcher("/logout", "GET"))
.and()
.authorizeRequests()
.antMatchers("/login", "resources/**").permitAll()
.anyRequest().authenticated();
}