Facebook自动更新长期访问令牌 [英] Facebook auto renewal of long access token

查看:114
本文介绍了Facebook自动更新长期访问令牌的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有人可以澄清所有Facebook令牌都是有时间限制的,并且如果没有人工干预,您实际上不能拥有超过90天的令牌吗?

I was wondering if anyone could clarify that all Facebook tokens are time bound and you can't actually have a token lasting more than 90 days without human interaction?

我在网站上发布了一个简单的页面,即Facebook feed,现在我需要手动刷新访问令牌&每90天更新一次请求?如果我要在客户的一些网站上使用这个可爱的Facebook提要,我必须确保他们不休假,否则他们的提要会离线吗?

I have a simple page post facebook feed on a website, I now need to manually refresh the access token & update the request every 90 days? If I want this lovely facebook feed on a few of my client's websites I'm gonna have to make sure they don't go on holiday else their feed will go offline?

推荐答案

扩展页面令牌不会过期:

Extended Page Tokens do not expire: https://developers.facebook.com/docs/facebook-login/access-tokens/expiration-and-extension

确保不要使用在客户端代码中硬编码的任何令牌.令牌始终必须保密.同样,在服务器上缓存API结果,因此您不必为每个用户都访问API.否则,您可能会遇到API限制.

Make sure not to use any Token hardcoded in clientside code. Tokens always have to be kept secret. Also, cache API results on the server, so you do not have to hit the API for every user. Else, you may run into API limits.

您还可以使用Webhooks来获取页面的实时更新: https://developers.facebook.com/docs/graph-api/webhooks/

You can also use webhooks to get realtime updates of your Page: https://developers.facebook.com/docs/graph-api/webhooks/

扩展页令牌确实会在60天后过期.

这篇关于Facebook自动更新长期访问令牌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆