如何在图形API中获取永久访问令牌 [英] How to get permanent access token in graph API
问题描述
使用此访问令牌,我可以使用 restfb
API在页面上发布消息,但是当我注销时,它开始抛出会话无效错误
。
我在几封帖中阅读了offline_access已被弃用。有人可以告诉我如何获得永久访问令牌?
谢谢
p>查看文档: https://developers.facebook.com/roadmap/离线访问删除/ 这是不可能的。
桌面应用程序将无法延长
存在access_token,用户必须登录到Facebook一旦
令牌已过期。
否则,可能要求具有较长期限的访问令牌。以下是方向: https://developers.facebook.com/roadmap/offline -access-removal /#extend_token
I created an APP on Facebook and using graph API explorer, I selected my app from app drop down box, requested access token with manage_pages, offline_access and publish_stream permissions.
Using this access token, I was successfully able to post message on page using restfb
APIs but when I log out, it starts throwing The session is invalid error
.
I read on few posts that offline_access is deprecated. Could someone tell me how to obtain permanent access token?
Thanks
Looking at the docs at: https://developers.facebook.com/roadmap/offline-access-removal/ this is no longer possible.
Desktop applications will not be able to extend the life of an existing access_token and the user must login to facebook once the token has expired.
Otherwise, it is possible to request an access token with a longer expiration. Here are the directions: https://developers.facebook.com/roadmap/offline-access-removal/#extend_token
这篇关于如何在图形API中获取永久访问令牌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!