Facebook页面Accesstoken和签名请求是否可以在客户端javascript中公开。 ?是存储在数据库中还是存储在服务器上的好选项?
FB.login(function (response) {
if (response.authResponse) {
FB.api('/me/permissions', function (perms_response) {
call to server with this response..
}
});
} else {
// User cancelled login or did not fully authorize.
}
}, { scope: 'manage_pages' }
);
问题是response.authResponse.accessToken,response.authResponse.userID,response.authResponse.signedRequest在客户端可见,或者这需要在服务器端完成
答案 0 :(得分:0)
当然可以,有什么区别?
只是因为客户端暴露,所以不应该从客户端请求这些。
应用访问令牌就像是您应用的密码,如果它被泄露给某人,他可以使用您的应用编辑/销毁/做任何事情!
所以你要做的是不推荐。
获取应用访问令牌 -
您可以直接从此处获取:https://developers.facebook.com/tools/accesstoken/
您可以在此致电 -
GET /oauth/access_token?
client_id={app-id}
&client_secret={app-secret}
&grant_type=client_credentials