2012-06-26 243 views
1

我是facebook新手,我有一些与Facebook身份验证相关的问题。 我已经创建了一个应用程序并编辑了域和URL。Facebook身份验证API

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

我用我的网站上的网页以下内容:

<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> 

而且我创建的页面 'channel.html' 只有这样的:

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

最后我用了登录按钮:

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

我做错了什么? 我不断收到此错误:

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.

回答

1

http://www.giftme.web44.net/不等于http://giftme.web44.net/

+0

但Facebook不接受都等于...... –

+0

我改变它们了,现在他们都是HTTP:// giftme。 web44.net –

0

的REDIRECT_URL必须包含网站的网址或帆布URL在你的应用程序属性定义。

一个例子是:

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

+0

我可以在哪里定义redirect_url? –

+0

我在哪里可以找到redirect_uri?或者我必须将其添加到脚本中? 我需要设置画布网址? –

+0

已更新的答案。 – Drewness