title: CORS rejection in Disqus Authentication
body: <p>I'm trying to use Disqus OAuth2 authentication. This is what I did:</p>
  
  <p>1: Created a disqus application and set <code>http://myweb/login</code> as callback uri and <code>myweb</code> in the Domain textarea (Domains linked to your public key (for referral checks)).</p>
  
  <p>2: Tried to make XHR GET request on <code>disqus.com/api/oauth/2.0/authorize</code> from <code>http://myweb/somepage</code>. CORS error appears. </p>
  
  <p>I solved it by calling</p>
  
  <pre><code>window.open("https://disqus.com/api/oauth/2.0/authorize/?
  client_id="+id+"&amp;scope=read&amp;response_type=code&amp;redirect_uri=http://myweb/login",
  "_blank");
  </code></pre>
  
  <p>Where <code>id</code> is th ID of my application. This works, I get the <code>code</code> response in the URL.</p>
  
  <p>3: Now I need to POST to retrieve the access token. CORS error again. I tried to create and submit form and the server response is OK.</p>
  
  <p>The errors are:</p>
  
  <pre><code>XMLHttpRequest cannot load https://disqus.com/api/oauth/2.0/authorize/?
  client_id=...&amp;redirect_uri=http://myweb/login. No 'Access-Control-Allow-Origin'
  header is present on the requested resource.
  Origin 'http://myweb' is therefore not allowed access.
  </code></pre>
  
  <p>I feel that I am doing something wrong, that the disqus OAuth2 server should set <code>Access-Control-Allow-Origin</code> for my application or something. So how to avoid the CORS errors in HTTP requests?</p>
  
  <p>I don't want to use PHP or jQuery to solve this.</p>