Facebook authentication API

2019-07-11 04:55发布

I'm new to facebook API and I have some questions related to facebook authentication. I have created an application and have edited the domain and url.

Website Domain giftme.web44.net Site URL http://www.giftme.web44.net/

I used the following on my site webpage:

<div id="fb-root"></div>
  <script>
    window.fbAsyncInit = function() {
      FB.init({
        appId      : '3347207XXXXXXXX', // App ID (I've replaced for security reasons)
        channelUrl : 'http://giftme.web44.net/channel.html/', // Channel File
        status     : true, // check login status
        cookie     : true, // enable cookies to allow the server to access the session
        xfbml      : true  // parse XFBML
      });
      // Additional initialization code here
    };
    // Load the SDK Asynchronously
    (function(d){
       var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
       if (d.getElementById(id)) {return;}
       js = d.createElement('script'); js.id = id; js.async = true;
       js.src = "//connect.facebook.net/en_US/all.js";
       ref.parentNode.insertBefore(js, ref);
     }(document));
  </script>

And I've created the page 'channel.html' with only this:

<script src="//connect.facebook.net/en_US/all.js"></script>

Finally I used the login button:

<div class="fb-login-button" >Login with Facebook</div>

What i'm I doing wrong? I keep getting this error:

API Error Code: 191 API Error Description: The specified URL is not owned by the application Error Message: Invalid redirect_uri: A URL informada não é permitida pela configuração do aplicativo.

2条回答
姐就是有狂的资本
2楼-- · 2019-07-11 05:09

http://www.giftme.web44.net/ is not equal to http://giftme.web44.net/

查看更多
再贱就再见
3楼-- · 2019-07-11 05:10

The redirect_url must contain the Site URL or Canvas URL as defined in your App Properties.

An example would be:

https://api.facebook.com/method/admin.setAppProperties?
  access_token=CURRENTTOKEN&
  properties={'post_authorize_redirect_url':'http://giftme.web44.net/channel.html/'}

Error code 191
FB App Properties

查看更多
登录 后发表回答