title: has been blocked by CORS policy: Response to preflight request doesn't pass
body: <p>I have created one app using angular and springboot for basic authentication with spring security but i am getting 401 error ..i am novice in springboot</p>
  
  <pre class="lang-java prettyprint-override"><code>@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();
      }
  }
  </code></pre>
  
  <blockquote>
    <p>"Access to XMLHttpRequest at '<a href="http://localhost:8080/hello-world/path-variable/MSD" rel="nofollow noreferrer">http://localhost:8080/hello-world/path-variable/MSD</a>' from origin '<a href="http://localhost:4200" rel="nofollow noreferrer">http://localhost:4200</a>' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status."</p>
  </blockquote>