简体   繁体   中英

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.

I started to test the graph api, and I generated a token for my personal facebook acount using my own fb application. 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 ?

在此处输入图片说明

why my token doesn't expire in a few hours as is specified in the graph api documentation ?

That's a “side effect” of manage_pages permission.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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