Facebook auto renewal of long access token

喜夏-厌秋 提交于 2020-01-16 16:13:57

问题


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?

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?


回答1:


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

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.

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

Edit: Extended Page Tokens do expire now, after 60 days.



来源:https://stackoverflow.com/questions/51085866/facebook-auto-renewal-of-long-access-token

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!