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

查看:31
本文介绍了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.

要扩展该用户令牌,请调用交换命令 (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天全站免登陆