title: Facebook login on azure served app OAuth redirect changes to .com instead of .net
body: <p>My meteor app is hosted on azure virtual machine as a cloud service.</p>
  
  <p>I followed this tutorial: <a href="http://bulenttastan.net/login-with-facebook-using-meteor-js/" rel="nofollow">http://bulenttastan.net/login-with-facebook-using-meteor-js/</a></p>
  
  <p>I have a facebook login button and I use a <code>Meteor.loginWithFacebook</code> method. It worked well on localhost, but after deployment to server, while facebook login popup appears and redirects I get error:
  <code>Given URL is not whitelisted in Client OAuth Settings: This redirect failed because the redirect URI is not whitelisted in the app’s Client OAuth Settings. Make sure Client and Web OAuth Login are on and add all your app domains as Valid OAuth Redirect URIs.</code></p>
  
  <p>On facebook app config page I tried variuos white list addresses, now it's <code>http://zamieszkajz.cloudapp.net/_oauth/facebook?close</code>.</p>
  
  <p>Whats strange for me is that address which appears on facebook popup contains .com ending instead of .net (ex. <code>https://www.facebook.com/v2.2/dialog/oauth?client_id=209052379430181&amp;redirect_uri=http://zamieszkajz.cloudapp.com/_oauth/facebook?close&amp;display=popup&amp;scope=email&amp;state=eyJsb2dpblN0eWxlIjoicG9wdXAiLCJjcmVkZW50aWFsVG9rZW4iOiJ2SVZ6eUNxV0dFLXFZNDRScm1MVGVIMDBBMW11WFpCNmh0bHNsYWEwNDJoIiwiaXNDb3Jkb3ZhIjpmYWxzZX0=</code> - app default address is <a href="http://zamieszkajz.cloudapp.net" rel="nofollow">http://zamieszkajz.cloudapp.net</a> . It seems like azure or facebook are changing this ending. Sometimes you may be redirected to bing search.</p>
  
  <p>Login method:</p>
  
  <pre><code>'click .step-button-signin': function (e, template) {
      e.preventDefault();
      Meteor.loginWithFacebook({
      loginStyle: "popup",
          }, function (error) {
          if (error) {
              throwError(error.reason);
          } else {
              console.log("logged in");
          }
      });
  return false;
  },
  </code></pre>
  
  <p>I'll appreciate any help and tips how to correct it :)
  It works like charm when set up to localhost.</p>