我可以获得有效期为 60 天的访问 token ,但无法延长到期时间。我这样做是为了能够通过单个用户访问 Facebook 页面。这是我的过程。
然后我使用从上面的 URL 获得的 token 调用这个 URL: https://graph.facebook.com/oauth/access_token?client_id=APP_ID&client_secret=APP_SECRET&grant_type=fb_exchange_token&fb_exchange_token=EXISTING_ACCESS_TOKEN
这个周末我已经尝试了多次,在每一个实例中,我都获得了相同的访问 token ,但过期时间没有更新。我通过在浏览器中访问 URL 来完成此操作。
我是否遗漏了任何能够续期的东西?
最佳答案
我认为页面管理员用户必须在 60 天内返回您的应用程序才能获得带有延长时间的新访问 token 。我认为您不能(或不应该)被允许仅通过应用程序扩展访问 token 。
参见:https://developers.facebook.com/docs/offline-access-deprecation/
Note: The user must access your application before you're able to get a valid "authorization code" to be able to make the server-side oAuth call again. Apps will not be able to setup a background/cron job that tries to automatically extend the expiration time, because the "authorization code" is short-lived and will have expired.
关于facebook - 访问 token 过期未延长,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9163432/