Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get permanent access token in graph API

I created an APP on Facebook and using graph API explorer, I selected my app from app drop down box, requested access token with manage_pages, offline_access and publish_stream permissions.

Using this access token, I was successfully able to post message on page using restfb APIs but when I log out, it starts throwing The session is invalid error.

I read on few posts that offline_access is deprecated. Could someone tell me how to obtain permanent access token?

Thanks

like image 947
RandomQuestion Avatar asked Apr 06 '12 23:04

RandomQuestion


1 Answers

Looking at the docs at: https://developers.facebook.com/roadmap/offline-access-removal/ this is no longer possible.

Desktop applications will not be able to extend the life of an existing access_token and the user must login to facebook once the token has expired.

Otherwise, it is possible to request an access token with a longer expiration. Here are the directions: https://developers.facebook.com/roadmap/offline-access-removal/#extend_token

like image 136
Alex Rockwell Avatar answered Oct 12 '22 05:10

Alex Rockwell