title: Facebook API sending Error response when trying to run with localhost
body: <p>I have created a small application in local host.</p>
  
  <p>I have checked in the wieshark that :</p>
  
  <p>Request going is :</p>
  
  <blockquote>
    <p>HTTP GET:
    <a href="http://www.facebook.com/dialog/oauth?api_key=APPID&amp;app_id=APPID&amp;channel_url=http%3A%2F%2Fstatic.ak.facebook.com%2Fconnect%2Fxd_arbiter.php%3Fversion%3D9%23cb%3Df17ca8709c%26origin%3Dhttp%253A%252F%252F127.0.0.1%253A8080%252Ffd1147b44%26domain%3D127.0.0.1%26relation%3Dparent.parent&amp;client_id=121312018012923&amp;display=none&amp;domain=127.0.0.1&amp;locale=en_US&amp;origin=1&amp;redirect_uri=http%3A%2F%2Fstatic.ak.facebook.com%2Fconnect%2Fxd_arbiter.php%3Fversion%3D9%23cb%3Df164e7a46c%26origin%3Dhttp%253A%252F%252F" rel="nofollow">http://www.facebook.com/dialog/oauth?api_key=APPID&amp;app_id=APPID&amp;channel_url=http%3A%2F%2Fstatic.ak.facebook.com%2Fconnect%2Fxd_arbiter.php%3Fversion%3D9%23cb%3Df17ca8709c%26origin%3Dhttp%253A%252F%252F127.0.0.1%253A8080%252Ffd1147b44%26domain%3D127.0.0.1%26relation%3Dparent.parent&amp;client_id=121312018012923&amp;display=none&amp;domain=127.0.0.1&amp;locale=en_US&amp;origin=1&amp;redirect_uri=http%3A%2F%2Fstatic.ak.facebook.com%2Fconnect%2Fxd_arbiter.php%3Fversion%3D9%23cb%3Df164e7a46c%26origin%3Dhttp%253A%252F%252F</a>*<em>127.0.0.1%253A8080%</em>*252Ffd1147b44%26domain%3D127.0.0.1%26relation%3Dparent%26frame%3Df216567208&amp;response_type=token%2Csigned_request%2Ccode&amp;sdk=joey</p>
  </blockquote>
  
  <p>Facebook is sending 200 OK:</p>
  
  <blockquote>
    <p>[truncated] Given URL is not allowed by the Application configuration.: One or more of the given URLs is not allowed by the App&#039;s settings.  It must match the Website URL or Canvas URL, or the domain must be a subdomain of one o</p>
  </blockquote>
  
  <p>I am not getting what the issue is :
  I have XAMPP running on my localhost.
  In the canvas and site URL I have : <a href="http://mytestdomain.com:8080" rel="nofollow">http://mytestdomain.com:8080</a>.</p>
  
  <p>in my machine in /etc/hosts I have 127.0.0.1 mytestdomain.com.</p>
  
  <p>The Actual code I am running</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;body&gt;
          &lt;div id="fb-root"&gt;&lt;/div&gt;
  &lt;script&gt;
  
        window.fbAsyncInit = function() {
            FB.init({appId: 'APPID', status: true, cookie: true, xfbml: true});
  
        };
        (function() {
          var e = document.createElement('script'); e.async = true;
          e.src = document.location.protocol +
            '//connect.facebook.net/en_US/all.js';
          document.getElementById('fb-root').appendChild(e);
        }());
  
        FB.getLoginStatus(function(response) {         
          if (response.status == "connected") {
          alert("yes I am in ");
          }
          else{
          alert(" you need to login to facebook:");
          }
          });
  
      function checkFacebookLogin() {
      alert("hai");
      }
  
      &lt;/script&gt;
  
  
   &lt;p id="fb_login_button_1"&gt;&lt;fb:login-button onlogin="checkFacebookLogin();" size="medium" scope="email"&gt;Sign in using Facebook&lt;/fb:login-button&gt;&lt;/p&gt;
  
  &lt;/body&gt;
  </code></pre>