2011-01-05 34 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

相关问题