Unable to get code to request a long-lived token from Facebook

Viewed 145

We have a usecase where a user uses facebook social login to sign in our application and we get the long-lived access token with 60 days expiration time. But as it expires in 60 days, we don't want to prompt for logging-in again through facebook; rather refreshing the token on our end. To add to that, using the same long-lived access token frequently comes with the risk of the application being flagged as spam. I came across a link that is : https://developers.facebook.com/docs/facebook-login/access-tokens/refreshing/ where we can redeem another long-lived access token with the help of the code. But, when I try to retrieve the code through a test user's short-lived access token; it works. On the other hand, if I try to get the code with the help of my long-lived access token(which is valid and works well when hitting Graph API), I get the error :

{"error":{"message":"Invalid OAuth access token data.","type":"OAuthException","code":190,"fbtrace_id":"AlAiFbxLbeP5YifJLRdTXHG"}}

Please help me.Thanks in advance!

0 Answers
Related