Fb_exchange_token for PHP only works after the user uninstalls the application

For the Facebook application that I create, it takes me longer than the default of 1 - 2 hours.

I do not want to use "offline_access" as it disconnects people from registration in the application and is now depreciating.

The developer's roadmap refers to "fb_exchange_token", which will extend the validity of the access token up to 1 month.

Flow:

  • Login

  • Call ... / oauth / access_token? ... & grant_type = fb_exchange_token & fb_exchange_token = ...

  • Access current now lasts 1 month.

This is great for all new users and for users who remove the application from their Facebook account and re-add it, but this does not work for our existing client base.

I tried all sorts, including adding other permissions to login the script to force the authentication window, but no luck.

I added the correct advanced / port setting for the Facebook app as described in the documentation. It doesn't seem to help much except the dev blog.

Any help would be greatly appreciated.

FYI: I use the most advanced PHP SDK, and the code to get a new access token is a standard cURL request pointing to the following URL:

https://graph.facebook.com/oauth/access_token?client_id= {APPID} & client_secret = {APPSECRET} & grant_type = fb_exchange_token & fb_exchange_token = {ACCESSTOKEN}

Thanks again

+7
source share
2 answers

I have the same problem. Another thing I noticed: users who previously had offline_access permission could also receive 60-day tokens, as well as new authorized users.

I opened an error to try to get a response from FB: https://developers.facebook.com/bugs/241373692605971

+2
source

I ran into this problem and found that it just worked just for me, it was removing the application from my profile and re-adding the application, and this allowed me to create a 60-day token.

0
source

All Articles