I'm trying to access content from "src\main\resources\static" folder but i got 401 errors in inspect window in chrome.
Inside of "static" folder i have sub folder called "assets" and the structure bit like this.
assets/css/**
assets/js/**
assets/fonts/**
assets/image/**
assets/css/boostrap/**
this is my WebMvcConfigurerAdapter
class
@Configuration
public class OAuthWebFormConfiguration extends WebMvcConfigurerAdapter {
@Override
public void addViewControllers(ViewControllerRegistry registry) {
registry.addViewController("/login").setViewName("login");
registry.addViewController("/oauth/confirm_access").setViewName("authorize");
}
@Configuration
@Order(-20)
protected static class LoginConfig extends WebSecurityConfigurerAdapter {
@Autowired
private CustomAuthenticationManager customAuthenticationManager;
@Override
protected void configure(HttpSecurity http) throws Exception {
http.formLogin().loginPage("/login").permitAll()
.and()
.requestMatchers()
.antMatchers("/login", "/oauth/authorize", "/oauth/confirm_access")//,"/resources/**", "/assets/**"
.and()
.authorizeRequests()
.anyRequest()
.authenticated();
}
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.parentAuthenticationManager(customAuthenticationManager);
}
}
}