Я пытаюсь получить доступ к содержимому из папки "src \ main \ resources \ static", но я получил 401 ошибку в окне проверки в chrome.
Внутри «статической» папки у меня есть подпапка под названием «assets» и структура немного похожа на эту.
assets/css/**
assets/js/**
assets/fonts/**
assets/image/**
assets/css/boostrap/**
это мой WebMvcConfigurerAdapter
класс
@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);
}
}
}