1
votes

I want to extend my existing token.

I make a facebook authentication with server side call and I got fb access_token with 60 days time.

Then next day I make a call, 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

In FB documentation https://developers.facebook.com/roadmap/offline-access-removal/ they says,

our platform will only extend the expiration time once per day, so even if a user revists your site multiple times a day, the token will be extended the first time requested

But I got same access_token without time extended.

How to extend my existing token?


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.”

You told returned token will have fresh long-lived expiration time.

For example EXISTING_ACCESS_TOKEN - valid token with 50 days validity

I make a call with query 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.

In that response facebook returned same token and same 50 days time validity. After 50 days this token will be expired.

My question is how to extend my expiration time? Or What is wrong with this query?

1

1 Answers

0
votes

But I got same access_token without time extended.

Off course you do, because that's exactly what's descriped under "Scenario 4" here: https://developers.facebook.com/roadmap/offline-access-removal/#extend_token

It's all in there, you just have to read it ;-)

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. [...] 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 below.