Был заблокирован политикой CORS: ответ на запрос на предварительный полете не проходитJAVA

Программисты JAVA общаются здесь
Anonymous
Был заблокирован политикой CORS: ответ на запрос на предварительный полете не проходит

Сообщение Anonymous »

Я создал одно приложение, используя Angular и Springboot для базовой аутентификации с Spring Security, но я получаю 401 ошибка .. я новичок в Springboot < /p>

Код: Выделить всё

@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 at 'http: // localhost: 8080/hello-world/path-variable/msd' from inory 'http: // localhost: 4200'. Статус. "


Подробнее здесь: https://stackoverflow.com/questions/569 ... oesnt-pass

Вернуться в «JAVA»