https://developers.facebook.com/docs/facebook-login/using-login-with-games/
他们声称json对象是
{
"oauth_token": "{user-access-token}",
"algorithm": "HMAC-SHA256",
"expires": 1291840400,
"issued_at": 1291836800,
"user_id": "218471"
}
但是我明白了
{
"algorithm": "HMAC-SHA256",
"code": "xxxxxx",
"issued_at": 1291836800,
"user_id": "218471"
}
备注:
我的应用处于沙盒模式
权限:电子邮件; user_about_me;用户生日;用户兴趣;用户位置;用户游戏事件
有人知道怎么解决吗?
最佳答案
Whenever someone has already logged into your game with Facebook Login, the signed request will contain an oauth_token property that gives you a token to use to make API calls.
您应该使用 JavaScript SDK 处理登录,而不是在启动 Canvas 应用时发送的 POST 日期之前。
如果您不想在他登录之前获取一些信息,您应该用代码交换访问 token
要获取访问 token ,请向以下 OAuth 端点发出 HTTP GET 请求:
GET https://graph.facebook.com/oauth/access_token?
client_id={app-id}
&redirect_uri={redirect-uri}
&client_secret={app-secret}
&code={code-parameter}
您使用 ajax 来防止页面刷新。
关于facebook - Facebook signed_request 中缺少用户、oauth_token、expires,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16954553/