Код: Выделить всё
@Configuration
@EnableWebSecurity
public class SpringSecurityConfigurationBasicAuth extends WebSecurityConfigurerAdapter{
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.csrf().disable()
.authorizeRequests()
.antMatchers(HttpMethod.OPTIONS,"/**").permitAll()
.anyRequest().authenticated()
.and()
//.formLogin().and()
.httpBasic();
}
}
"Доступ к XMLHttpRequest по адресу 'http://localhost:8080/hello-world/path-variable/MSD' из источника 'http://localhost:4200' заблокирован политикой CORS: ответ на предполетный запрос не проходит проверку контроля доступа: у него нет статуса HTTP ok."
Подробнее здесь: https://stackoverflow.com/questions/569 ... oesnt-pass
Мобильная версия