title: HybridAuth not working with ajax
body: <p>I'm trying to implement HybridAuth with ajax. </p>
  
  <p>Code:</p>
  
  <p>PHP: (will be called by ajax)</p>
  
  <pre><code>&lt;?php
  header('Content-type: application/json');
  $provider = $_GET["provider"];
  $config = '../libaries/hybridauth/config.php';
  require_once( "../libaries/hybridauth/Hybrid/Auth.php" );
  try {
      $hybridAuth = new Hybrid_Auth($config);
  
      $adapter = $hybridAuth-&gt;authenticate($provider);    
      $userProfile = json_encode($adapter-&gt;getUserProfile());
      echo $_GET['callback'] . '(' . "{$userProfile}" . ')';
  } catch (Exception $e) {
      echo "Ooophs, we got an error: " . $e;
  }
  ?&gt;
  </code></pre>
  
  <p>Javascript:</p>
  
  <pre><code>socialRegister: function () {
      var self = this;
      var val = 'provider=' + self.get("provider");
      return $.ajax({
          type: "GET",
          url: path.urlRoot + 'ext/socialRegisterAndAuthentication.inc.php',
          dataType: "jsonp",
          data: val
      });
  }
  </code></pre>
  
  <p>But I always get following error:</p>
  
  <blockquote>
    <p>XMLHttpRequest cannot load <a href="https://api.twitter.com/oauth/authenticate?oauth_token=123" rel="nofollow noreferrer">https://api.twitter.com/oauth/authenticate?oauth_token=123</a>. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '<a href="http://localhost" rel="nofollow noreferrer">http://localhost</a>' is therefore not allowed access.</p>
  </blockquote>
  
  <p>I know, that this means, that the Twitter Server is not allowing my origin. Is there a workaround? Is a "One-Page" signUp with ajax possible? (Hopefully yes - on quora.com it works ;) )</p>
  
  <p>TWITTERSETTINGS:
  <img src="https://i.stack.imgur.com/Z07wE.jpg" alt="enter image description here"></p>
  
  <p>Best
  Fabian</p>