title: Angular -> keycloak No 'Access-Control-Allow-Origin'
body: <p>I am trying to connect to Keyckloak to get the 'access_token' with angular. But I have this error : </p>
  
  <p>Failed to load <a href="http://localhost:8080/auth/realms/demo/protocol/openid-connect/token" rel="nofollow noreferrer">http://localhost:8080/auth/realms/demo/protocol/openid-connect/token</a>: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '<a href="http://localhost:4200" rel="nofollow noreferrer">http://localhost:4200</a>' is therefore not allowed access. The response had HTTP status code 400.</p>
  
  <p>I give you my code : </p>
  
  <pre><code>readonly ROOT_URL = 'http://localhost:8080/auth/realms/demo/protocol/openid-connect/token';
  posts : any;    
  
  constructor(private http: HttpClient) {}
  
  getToken() {
  const data: Post = {
  username: 'pierrecolart',
  password: 'root',
  grant_type: 'password',
  client_id: 'admin-cli'
  }
  this.http
      .post(
          this.ROOT_URL,
          data, 
          {headers: new HttpHeaders().set('Content-Type', 'application/x-www-form-urlencoded')}
      )
      .map(res =&gt; res.json())
      .subscribe(data =&gt; console.log(data))
  }
  </code></pre>