title: No 'Access-Control-Allow-Origin' header is present on the requested resource
body: <p>I am using omniauth-facebook with AngularJS and CORS is not working correctly .</p>
  
  <p>My omniauth.rb is </p>
  
  <pre><code>Rails.application.config.middleware.use OmniAuth::Builder do
  provider :facebook,"xxxxx", "xxxxx",
  :scope =&gt; 'email,user_birthday,read_stream', :display =&gt; 'popup'
  
  end
  </code></pre>
  
  <p>Everything works if i use it as rails app and request. But when i try to call 'http:\localhost:3000\users\auth\facebook" via Angular JS </p>
  
  <pre><code>$http.get('/users/auth/facebook').success(function(data, status, headers, config) {
              console.log("back in success");
              }).
              error(function(data, status, headers, config) {
  
              });
      }
  </code></pre>
  
  <p>i see following error in JS console</p>
  
  <blockquote>
    <p>XMLHttpRequest cannot load
    <a href="https://www.facebook.com/dialog/oauth?client_id=xxxx&amp;display=popup" rel="noreferrer">https://www.facebook.com/dialog/oauth?client_id=xxxx&amp;display=popup</a>…thday%2Cread_stream&amp;state=3352c1924bdbc9277f7b1070c38d67acf79b529f198323cb.
    No 'Access-Control-Allow-Origin' header is present on the requested
    resource. Origin <code>'http://localhost:3000'</code> is therefore not allowed
    access.</p>
  </blockquote>
  
  <p>(The url is not displayed completely in console)</p>
  
  <p>I added following line </p>
  
  <pre><code>config.middleware.insert_before Warden::Manager, Rack::Cors
  </code></pre>
  
  <p>but also this didn't work .</p>
  
  <p>What is the best way or how can i override headers for OmniAuth ? </p>
  
  <blockquote>
    <p>I am using Angularjs and gem devise ,omniauth-facebook</p>
  </blockquote>