有没有办法检查Facebook访问令牌是否仍然有效? [英] Is there a way to check if Facebook access token is still valid?
问题描述
我的网站使用终身访问令牌( offline_access
)。但是,如果用户更改了他/她的密码,则访问令牌将被重置。在调用Graph API之前,是否有一种检查当前访问令牌是否有效的方法?感谢您的时间。
My site utilizes lifetime access tokens (offline_access
). However, if the user changes his/her password, the access token gets reset. Is there a method to check if the current access token is valid before making calls to the Graph API? Thanks for your time.
推荐答案
基本上,FB希望您轮询,或者检测案例并将用户重定向到得到一个reauth发生。烦人,但官方:
Basically, FB wants you to poll for it, or to detect the case and redirect the user to get a reauth to occur. Annoying, but official:
(旧的,过期的链接,见下文) https://developers.facebook.com/blog/post/500/
编辑:Facebook改变了他们的链接结构,没有重定向。不要惊讶。
Facebook changed their link structure without redirects. Not surprised.
https://developers.facebook.com/blog/post/2011/05/13/how-to-handle-expired-access-tokens/
这篇关于有没有办法检查Facebook访问令牌是否仍然有效?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!