2012-06-26 241 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