所以我成功地让我的应用程序使用我的帐户将分数发布到 Facebook。但是当我去实施排行榜时,我尝试使用我妻子的帐户。当它尝试提交她的分数时,它返回“远程服务器返回错误:(403)禁止”。经过验证的我的工作仍然正常。可以重复复制。
这是 WCF 服务。
<WebGet()>
<OperationContract()> _
Public Function postMyScore(id, score) As String
'post user score using user's id, score and app's access_token
Dim URL As String = "https://graph.facebook.com/" + id + "/scores"
Dim webProxy As New System.Net.WebProxy(proxyURLremoved, True)
Dim appToken = getAuthCode()
Using client As New Net.WebClient
client.Proxy = webProxy
Dim reqparm As New Specialized.NameValueCollection
reqparm.Add("score", score)
reqparm.Add("access_token", appToken)
Dim responsebytes = client.UploadValues(URL, "POST", reqparm)
Dim responsebody = (New Text.UTF8Encoding).GetString(responsebytes)
Return responsebody
End Using
End Function
同样,当我以我的身份登录时,上述方法有效,但当我使用我妻子的帐户登录时则无效
当我尝试使用 Graph API Explorer 复制帖子时,我收到以下错误(可能是出于安全考虑)
{
"error": {
"message": "(#240) Requires a valid user is specified (either via the session or via the API parameter for specifying the user.",
"type": "OAuthException",
"code": 240
}
}