title: Access-Control-Allow-Origin denied spotify api
body: <p>I'm trying to access to the Spotify API token like so:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$.ajax({
    url: "https://accounts.spotify.com/api/token",
    type: 'POST',
    contentType: "application/json; charset=\"utf-8\"",
    crossDomain: true,
    data: {
      grant_type: "authorization_code",
      code: code,
      redirect_uri: "http://www.bancadigital.com.br/spotifyteste/callback.html"
    },
    processData: false,
    dataType: "json",
    headers: {
      Authorization: "Basic " + utf8_to_b64(key)
    },
    success: function( response ) {
      alert(response.access_token);
    },
  });</code></pre>
  </div>
  </div>
  </p>
  
  <p>but the service returns the following error:</p>
  
  <blockquote>
    <p>XMLHttpRequest cannot load <a href="https://accounts.spotify.com/api/token" rel="noreferrer">https://accounts.spotify.com/api/token</a>. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '<a href="http://www.bancadigital.com.br" rel="noreferrer">http://www.bancadigital.com.br</a>' is therefore not allowed access.</p>
  </blockquote>
  
  <p>Does anyone know how I can access the service?</p>