简体   繁体   English

Facebook用户访问令牌的有效性

[英]Facebook user access token validity

After I read the graph api documentation, I understood the usually a regular user token has around 2 hours validity, and you can extend it for another 60 days. 阅读了graph api文档后,我了解到通常的普通用户令牌的有效期约为2小时,您可以将其延长60天。

I started to test the graph api, and I generated a token for my personal facebook acount using my own fb application. 我开始测试图形API,并使用自己的fb应用程序为我的个人facebook帐户生成了令牌。 I was surprised to find out the this token has the expiration date set to never. 我很惊讶地发现此令牌的有效期限设置为永不。

Please have a look over the print screen which contains debug info about the token. 请查看包含有关令牌的调试信息的打印屏幕。 So the question is: why my token doesn't expire in a few hours as is specified in the graph api documentation ? 所以问题是:为什么我的令牌不会在graph api文档中指定的几个小时后过期?

在此处输入图片说明

why my token doesn't expire in a few hours as is specified in the graph api documentation ? 为什么我的令牌不会在graph api文档中指定的几个小时后过期?

That's a “side effect” of manage_pages permission. 这是manage_pages权限的“副作用”。

Extended page access tokens do have unlimited validity. 扩展页面访问令牌确实具有无限的有效性。 And page access tokens still need to be tied to the user that created them somehow (if the user is removed as admin for the page, the page token needs to get invalidated as well) – so for implementation reasons Facebook chose the way of making the user access token have unlimited validity in this case as well. 而且页面访问令牌仍需要与以某种方式创建它们的用户绑定(如果以页面管理员的身份将用户删除,则页面令牌也需要失效)–因此出于实现原因,Facebook选择了制作令牌的方法。在这种情况下,用户访问令牌也具有无限的有效性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM