Extending valid/expired 60 days access token without user interaction

烈酒焚心 提交于 2019-12-04 17:59:10

The whole point of the 60 day expiry is so that users re-visit your application at the end of the expiration and you drive them back through the login process.

  • Get short lived token
  • Re-extend

Extending a 60 day without user interaction defeats the entire process. If your user hasn't interacted with your app in 60 days, the application permission should expire.

achasinh

https://developers.facebook.com/docs/roadmap/completed-changes/offline-access-removal

The offline_access Permission that you could use to extend an already extended 60 day permission once a day has been removed by facebook.

Now, you're using the right URL, but the terms are these:

Client-side OAuth and Extending Access_Token Expiration Time through New Endpoint

Using the new endpoint, you will be able to extend the expiration time of an existing, non-expired, short-lived user access_token. Please note, the endpoint can only be used to extend the short-lived user access_tokens. If you pass an access_token that had a long-lived expiration time, the endpoint will simply pass that same access_token back to you without altering or extending the expiration time.

To get the long-lived user access_token simply pass your own client_id (your app_id), your app_secret, and the non-expired, short-lived access_token to the endpoint below. You will be returned a new long-lived user access_token; this access_token will exist in addition to the short-lived access_token that was passed into the endpoint. If you would like to refresh a still valid long-lived access_token, you will have to get a new short-lived user access_token first and then call the same endpoint. The returned access_token will have a fresh long-lived expiration time, however, the access_token itself may or may not be the same as the previously granted long-lived access_token.

https://graph.facebook.com/oauth/access_token?             
client_id=APP_ID&
client_secret=APP_SECRET&
grant_type=fb_exchange_token&
fb_exchange_token=EXISTING_ACCESS_TOKEN

I was going to paste the explanation on how to "Generating Long-Lived User Tokens from Server-Side Long-Lived Tokens" that you can read: http://developers.facebook.com/docs/facebook-login/access-tokens#long-via-code

But it seems like this issue has already been discussed: Facebook PHP SDK 4.0 : Getting Long Term Access Token

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!