0

I want to generate an access token which is long lived. I have tried generating token using extended permission manage_page. But then the token used to expire after a few hours.

Also 2 years back there was an issue since offline access was deprecated.

I have read on facebook long lived access token but I cannot figure out how to generate a long lived access token i.e probably 60 days.

I know that using Tools in facebook we can generate it but can anyone provide me assistance in generating a long lived access token.

Thanks in Advance.

user3230561
  • 445
  • 1
  • 10
  • 21
  • http://stackoverflow.com/questions/19832319/renew-or-create-permanent-facebook-access-token-to-post-app-page/19834754#19834754 – Surabhil Sergy Feb 04 '14 at 07:34

2 Answers2

0

Currently the long-lived user access_token will be valid for 60 days while the short-lived user access_tokens are currently valid from 1 to 2 hours.

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

Surabhil Sergy
  • 1,946
  • 1
  • 23
  • 40
0

You can hit the facebook services through the below mentioned URL:

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

You will need to fill in your App_id, App_Secret and the shortLivedAccessToken. In Return you will get the LONG LIVED Auth token from the Facebook in response which will look something like

CAACY2XUaAeYBAMCzGasdGdsfYTasdjgdER23xxxxxxxxxxxxpH19rZCiOlyhFfqWSWdxxxxxxxxxxxxxxxxxxxxx&expires=5184000

Ashish Gupta
  • 567
  • 4
  • 7