Facebook应用程序的访问令牌是否过期? [英] Does a Facebook application's access token expire?

查看:121
本文介绍了Facebook应用程序的访问令牌是否过期?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是与我的Facebook 应用程序相关联的访问令牌 - 从 https://graph.facebook.com/oauth/access_token?grant_type=client_credentials&client_id=APP_ID&client_secret=APP_SECRET 。我可以从FB获得一次,并将其保存在某个地方以备将来使用,还是需要定期刷新?

This is the access token associated with my Facebook application -- the thing that comes back from https://graph.facebook.com/oauth/access_token?grant_type=client_credentials&client_id=APP_ID&client_secret=APP_SECRET. Can I get this once from FB and save it away somewhere for future use, or do I need to refresh it on a regular basis?

推荐答案

对于每个用户令牌(这是您从链接获得的),都有一个到期日。使用其中一个令牌来 https://developers.facebook.com/tools/debug 并调试它。您将看到一般它们将在60分钟内到期。

For each and every user token (which is what you're getting from your link), there is an expiration date. Take one of those tokens to https://developers.facebook.com/tools/debug and debug it. You will see that generally they expire within 60 minutes or so.

要扩展该用户令牌,请调用exchange命令(https://developers.facebook.com/docs / offline-access-deprecation /),使其成为60天令牌。该用户令牌必须仍然有效(未过期)才能执行此操作。

To extend that user token, call the exchange command (https://developers.facebook.com/docs/offline-access-deprecation/) to get it to become a 60 day token. That user token has to be still valid (not expired) to do this.

这篇关于Facebook应用程序的访问令牌是否过期?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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