php – 续订长期访问令牌服务器端

我们正在从facebook中检索长期访问令牌,但是我们需要自动续订此令牌,以便它不会每60天到期.

阅读文档说它只能使用端点交换短期令牌.

由于我们没有短期令牌,我们如何在不必每60天手动重新授权的情况下执行此服务器端?

无法延长令牌是不可能的.请参见此处的场景4 https://developers.facebook.com/roadmap/offline-access-removal/

Using the new endpoint below,you will be able to extend the
expiration time of an existing,non-expired,short-lived user
access_token. Please note,the endpoint can only be used to extend
the short-lived user access_tokens
. If you pass an access_token that
had a long-lived expiration time,the endpoint will simply pass that
same access_token back to you without altering or extending the
expiration time.

To get the long-lived user access_token simply pass your own client_id
(your app_id),your app_secret,and the non-expired,short-lived
access_token to the endpoint below. You will be returned a new
long-lived user access_token; this access_token will exist in addition
to the short-lived access_token that was passed into the endpoint.
If you would like to refresh a still valid long-lived access_token,you will have to get a new short-lived user access_token first and then call the same endpoint below. The returned access_token will have a fresh long-lived expiration time,however,the access_token itself may or may not be the same as the prevIoUsly granted long-lived access_token.

相关文章

Hessian开源的远程通讯,采用二进制 RPC的协议,基于 HTTP 传输。可以实现PHP调用Java,Python,C#等多语...
初识Mongodb的一些总结,在Mac Os X下真实搭建mongodb环境,以及分享个Mongodb管理工具,学习期间一些总结...
边看边操作,这样才能记得牢,实践是检验真理的唯一标准.光看不练假把式,光练不看傻把式,边看边练真把式....
在php中,结果输出一共有两种方式:echo和print,下面将对两种方式做一个比较。 echo与print的区别: (...
在安装好wampServer后,一直没有使用phpMyAdmin,今天用了一下,phpMyAdmin显示错误:The mbstring exte...
变量是用于存储数据的容器,与代数相似,可以给变量赋予某个确定的值(例如:$x=3)或者是赋予其它的变...