title: Angular 4.1 Basic authentication with springboot webservices
body: <p>I'm trying to call Java springboot webservice with my Angular 4.1 application but there is a HTTP 401 error.</p>
  
  <p>My springboot webservice works fine with Firefox or rest client but not with angular. I think it's angular typescript problem.</p>
  
  <p>This is the Java EE error :  </p>
  
  <p><code>Access is denied (user is anonymous); redirecting to authentication entry point
  org.springframework.security.access.AccessDeniedException: Access is denied</code></p>
  
  <p>This is my angular code :</p>
  
  <pre><code>var headers = new Headers({authorization : "Basic " + btoa("j:j")});
  let options = new RequestOptions({ headers: headers });
  let url: string = 'http://localhost:8080/wstest';
  return this._http.get(url, options)
  .map((res: Response) =&gt; res.json())
  .subscribe(datas =&gt; {
    console.log(datas);
  });
  </code></pre>
  
  <p>When I use wireshark with browser webservice call, see basic autorization header :</p>
  
  <pre><code>Authorization: Basic ajpq\r\n
  Credentials: j:j
  </code></pre>
  
  <p>But, with angular call, there is no credentials :</p>
  
  <pre><code>Access-Control-Request-Headers: authorization
  </code></pre>
  
  <p>How can I call my springboot webservice with Angular 4.1 in order to add Basic authorisation credentials?</p>