title: Mailchimp authentication showing Access-Control-Allow-Origin
body: <p>When integrating with mailchimp, I do authentication after I get access_token then I also send a get request to get metadata and faces a problem.</p>
  
  <p>After synching user name and password I get access_token and I got error on this code: </p>
  
  <pre><code>var AccessToken = '&lt;?php //echo $_GET['access_token']; ?&gt;'
  jQuery.ajax( {
      url: "https://login.mailchimp.com/oauth2/metadata",
      type: 'GET',
      beforeSend : function( xhr ) {
          xhr.setRequestHeader( 'Authorization', 'OAuth ' +      
          AccessToken );
      },
      success: function( response ) {
          console.log(response);
      },
      error : function(error) {
          console.log(error);
      }
  } );
  </code></pre>
  
  <p></p>
  
  <p>I also tried from curl as:</p>
  
  <pre><code>public function list()
  {
    $url = 'https://login.mailchimp.com/oauth2/token';
    $data = [
      'grant_type' =&gt; 'authorization_code',
      'client_id' =&gt; 345555555555555555555555,
      'client_secret' =&gt; '4b0xxxxxxxxxxxxxxxxxxxxx5406a7d',
      'redirect_uri' =&gt; 'http://127.0.0.1:8000/success',
      'code' =&gt; $_GET['code']
      ];
   $ch = curl_init();
   curl_setopt($ch, CURLOPT_URL, $url);
   curl_setopt($ch, CURLOPT_POST, 1);
   curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
   curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
   $response = curl_exec ($ch);
   $err = curl_error($ch);  //if you need
   curl_close ($ch);
   return $response;
       }
  </code></pre>
  
  <pre><code>Access to XMLHttpRequest at 'https://login.mailchimp.com/oauth2/metadata' from origin 'http://127.0.0.1:8000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Cross-Origin Read Blocking (CORB) blocked cross-origin response https://login.mailchimp.com/oauth2/metadata with MIME type application/json. See https://www.chromestatus.com/feature/5629709824032768 for more details.
  send @ jquery.min.js:2
  ajax @ jquery.min.js:2
  (anonymous) @ list:74
  </code></pre>