title: get CORS problem when ty to get a token in keycloak with vuejs and axios
body: <p>I trying to access one keycloak with axios in my vuejs app, but I receive the cors error, can someone help me please? (If I make a post from POSTMAN to my keycloak works fine)</p>
  <p>I using this code:</p>
  <pre><code> const params = new URLSearchParams();
    params.append(&quot;grant_type&quot;, &quot;password&quot;);
    params.append(&quot;client_id&quot;, &quot;notas-front&quot;);
    params.append(&quot;username&quot;, usuario.value);
    params.append(&quot;password&quot;, password.value);
    console.log(params);
    const config = {
      //  withCredentials: true,
      headers: {
        &quot;Content-Type&quot;: &quot;application/x-www-form-urlencoded&quot;,
      },
    };
    axios.defaults.headers.common[&quot;Access-Control-Allow-Origin&quot;] =
      &quot;http://localhost:8080&quot;;
    axios
      .post(
        &quot;http://localhost:8082/auth/realms/lumera/protocol/openid-connect/token&quot;,
        params,
        config
      )
      .then((response) =&gt; {
        console.log(response);
      });
  </code></pre>
  <p>and get this error:
  <a href="https://i.stack.imgur.com/FHY4N.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FHY4N.png" alt="enter image description here" /></a></p>
  <p>but when I look the request I can't find the error:
  the OPTIONS returns 200
  <a href="https://i.stack.imgur.com/wrDWD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wrDWD.png" alt="enter image description here" /></a></p>
  <p>but the POST dont
  <a href="https://i.stack.imgur.com/vk0sX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vk0sX.png" alt="enter image description here" /></a></p>