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.

相关文章

统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
前言 之前做了微信登录,所以总结一下微信授权登录并获取用户...
FastAdmin是我第一个接触的后台管理系统框架。FastAdmin是一...
之前公司需要一个内部的通讯软件,就叫我做一个。通讯软件嘛...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...