JavaScript 中图形 api 调用的 access_token
我正在尝试使用 JavaScript 将公共 Facebook 页面上的帖子和评论拉入并显示在我客户的网页上。我知道我需要一个 access_token,但问题是它经常过期。看来我需要动态获取 access_token 以避免这个问题。有谁知道如何在客户端执行此操作?
I am trying to pull in and display the wall posts and comments from a public Facebook page on my client's webpage using JavaScript. I know I need an access_token, but the problem is it expires every so often. It seems I would need to dynamically get the access_token to avoid that issue. Does anyone know of a way to do this client-side?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
简短的回答:
如果页面确实是公开的,则根本不需要访问令牌。例如,
更长的答案,如果您使用特定用户的访问令牌代表他们执行操作,您可能会考虑请求“离线访问”,以便令牌不会过期。请参阅https://developers.facebook.com/docs/reference/api/permissions/< /a> 了解有关如何请求此权限的更多信息。
Short answer:
If the page is really public, you don't need an access token at all. For instance,
Longer answer, if you are using a particular user's access token to perform actions on their behalf, you might consider asking for "offline access" so that the token won't expire. See https://developers.facebook.com/docs/reference/api/permissions/ for more information about how to ask for this permission.