简体   繁体   中英

Refreshing Long Lived Facebook tokens with out user integration

I am developing a website integrated with facebook for posting and sharing contents. I have generated short lived user token and extend the token expiry by generating long lived using facebook graph api:

GET /oauth/access_token?  
grant_type=fb_exchange_token&           
client_id={app-id}&
client_secret={app-secret}&
fb_exchange_token={short-lived-token}

But this long lived token will get expired in 60 days after that it may required user interation for generate token again. Please help me if any methods to extend this expire date with out user interation. I found one solution which recommends to recall the 'get long lived token again' but its not at all working as expected. Please help me.

Long lived token gets extended for each API call(per day) on posting, sharing contents or fetching token details. Hence you can extend the token expiry by using below token debugging graph API call :

GET /debug_token?
  input_token={input-token}&
  access_token={access-token}

As this solution evolved from the practical research, please test the workflow before implementation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM