-1
我有一個使用JavaScript SDK的Facebook canvas iframe應用程序。如何獲取用戶的姓名,而無需授權該應用程序?Facebook JavaScript SDK無需身份驗證即可獲取用戶名
我有一個使用JavaScript SDK的Facebook canvas iframe應用程序。如何獲取用戶的姓名,而無需授權該應用程序?Facebook JavaScript SDK無需身份驗證即可獲取用戶名
不,這是不可能的。
當Facebook調用你的頁面,它通過張貼到iframe做,你會得到一個signed request其中最缺乏數據,如果用戶還沒有授權您的應用程序,因爲它在文檔中說:
Some fields and values, the user_id and oauth_token for example will only be passed if the user has authorized your app
的Graph API請求要求您提供一個積極的訪問令牌,否則你應該得到這個錯誤:(你可以檢查在Graph API Explorer;只是刪除訪問令牌嘗試之前)
{
"error": {
"message": "An active access token must be used to query information about the current user.",
"type": "OAuthException",
"code": 2500
}
}