2011-01-05 51 views
0

我只能使用php或curl找到示例。在Facebook上,我如何使用JavaScript驗證應用程序?

我要像做

https://graph.facebook.com/<app_id>/accounts/test-users? 
           installed=true&permissions=read_stream 

如記錄在這裏:http://developers.facebook.com/docs/authentication/#client_credentials

和反應是:

{ 
    "error": { 
     "type": "OAuthException", 
     "message": "An access token is required to request this resource." 
    } 
} 

以及是應該...所以我如何獲得JavaScript中的訪問令牌(顯然使用JavaScript SDK)。

謝謝!

回答

0

用戶通過JavaScript SDK連接後,您將擁有訪問令牌。

您並不需要在客戶端知道它們,因爲您可以使用FB.api來執行Graph API和REST API調用。

另請參閱:Facebook身份驗證指南,http://developers.facebook.com/docs/authentication/,特別是包含JavaScript SDK部件的單點登錄。

+0

謝謝。我並不想驗證用戶,而是應用程序。請參閱http://developers.facebook.com/docs/authentication/#client_credentials – GilShalit 2011-01-05 15:40:04

相關問題