title: Failed to load https://login.microsoftonline.com/common/oauth2/v2.0/token
body: <p>I'm trying to get a token using the Outlook REST API after I got the code from this url <code>https://login.microsoftonline.com/{tenant}/oauth2/v2.0/authorize</code></p>
  
  <p>I used a <code>POST</code> request with axios but the issue is I got this error:</p>
  
  <blockquote>
    <p>Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '<a href="http://localhost:3000" rel="nofollow noreferrer">http://localhost:3000</a>' is therefore not allowed access.</p>
  </blockquote>
  
  <p>My  Axios post is this:</p>
  
  <pre class="lang-js prettyprint-override"><code>return Axios({
      method: 'post',
      url: 'https://login.microsoftonline.com/common/oauth2/v2.0/token',
      headers: {
          'Content-Type': 'application/x-www-form-urlencoded',
          'Access-Control-Allow-Origin':'*', Content-Type, origin, authorization, accept, client-security-token"
      },
      data: {
          'client_id': 'xxxxxx',
          'scope': 'calendars.readwrite',
          'code': encodeURIComponent('000000000'),
          'redirect_uri': encodeURIComponent('http://localhost:3000/storeprofile/xxxxxxxxx/outlook-scheduler'),
          'grant_type': 'authorization_code',
          'client_secret': encodeURIComponent('xxxxxxxxxx')
      };,
      responseType: 'json'
      }).then((response) =&gt; {
          console.log('token response: ', response);
      });
  </code></pre>
  
  <p>I get a <code>200</code> status but can't see the token I am supposed to get in the response. The response should be a <code>json</code> but still nothing. </p>
  
  <p>Can someone please guide me? Thank you in advance!</p>