如何在图形API中获取永久访问令牌 [英] How to get permanent access token in graph API

查看:104
本文介绍了如何在图形API中获取永久访问令牌的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Facebook上创建了一个APP并使用图形API资源管理器,我从应用程序下拉框中选择了我的应用程序,请求使用manage_pages访问令牌,offline_access和publish_stream权限。



使用此访问令牌,我可以使用 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屋!

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