title: GET request is not called after successful OPTIONS call in angular with spring boot
body: <p>I'm trying to implement login functionality using angular and spring boot.</p>
  
  <p>Im following spring tutorial <a href="https://spring.io/guides/tutorials/spring-security-and-angular-js/" rel="nofollow noreferrer">https://spring.io/guides/tutorials/spring-security-and-angular-js/</a>
  But in my case my angular project is hosted on localhost:4200 and spring on localhost:8080</p>
  
  <p>Now im sending a '/user' request to spring server. My angular code look like:</p>
  
  <pre><code>const headers = new HttpHeaders(credentials ? {
          authorization: 'Basic ' + btoa(credentials.username + ':' + credentials.password)
      } : {});
  
      this.http.get('http://localhost:8080'+'/user', { headers: headers }).subscribe(response =&gt; {
          if (response['name']) {
              this.authenticated = true;
          } else {
              this.authenticated = false;
          }
          return callback &amp;&amp; callback();
      });
  </code></pre>
  
  <p>Now because of CORS it sends OPTIONS request which is successful with status 200. 
  After this it is not sending actual GET request which should send credentials as <a href="https://stackoverflow.com/questions/30254277/angular-http-is-sending-options-instead-of-put-post">Angular $http is sending OPTIONS instead of PUT/POST</a></p>
  
  <p>My spring code looks like this:</p>
  
  <pre><code>@CrossOrigin(origins = "*", maxAge = 3600, allowedHeaders={"x-auth-token", "x-requested-with", "x-xsrf-token"})
  @RequestMapping("/user")
  public Principal user(Principal user) {
      return user;
  }
  
  @Configuration
  @Order(SecurityProperties.DEFAULT_FILTER_ORDER)
  protected static class SecurityConfiguration extends WebSecurityConfigurerAdapter {
      @Override
      protected void configure(HttpSecurity http) throws Exception {
          http.httpBasic().and().cors().and().authorizeRequests().antMatchers("/index.html", "/", "/home", "/login").permitAll()
                  .anyRequest().authenticated().and().csrf()
                  .csrfTokenRepository(CookieCsrfTokenRepository.withHttpOnlyFalse());
      }
  }
  </code></pre>
  
  <p>Also i have added Spring Security in pom file.</p>
  
  <p>Can you please help to find out why GET request is not triggered after OPTIONS request.</p>