简体   繁体   中英

Extending Long-lived access tokens

I've been reading about the Removal of offline_access permission.

My goal is to extend the long-lived access token.

So what I'm trying to do, is refresh the long-lived token before the 60 days expiration, maybe on the 55th to 59th day.

The problem is, the documentation said that you can only extend short-lived access token .

However, when I do the solution in How to handle expired tokens post, both client-side and server-side auth flows give me the long-lived access token.

So my specific question is, where do I get a new short-lived token?

Once I get this short-lived token, I'll extend it and replace the existing nearly-expired long-lived token, therefore making a seamless experience.

Actually I cannot use the solution in How to handle expired tokens because my access_token is not yet expired. As I said, I'll be doing this in 55-59th day, before long-lived token expires.

It seems the user has granted a previous offline_access to the application. That's why both client-side and server-side auth flows return the long-lived access token. This happens even if migration is enabled in the app settings. Facebook should also note about this in their documentation. The solution is for the user to revoke the offline_access permission.

Hopefully all offline_access permissions will be revoked once they force the migration scheduled in May 2, see developer roadmap .

Case Closed. May this post help other users who encounter such rare situations.

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