criso / fbgraph

NodeJs module to access the facebook graph api
http://criso.github.io/fbgraph/
1.09k stars 177 forks source link

extend expired access_token #101

Closed przemyslawpluta closed 7 years ago

przemyslawpluta commented 8 years ago

Is there a way to extend expired token? After passing just expired access_token to graph.extendAccessToken all you get is err.

{
  message: 'Error validating access token: Session has expired on Tuesday, 03-May-16 11:00:00 PDT. The current time is Tuesday, 03-May-16 11:03:25 PDT.',
  type: 'OAuthException',
  code: 190,
  error_subcode: 463,
  fbtrace_id: 'PIFx4A1ghOh' }
FarmerKing commented 7 years ago

https://developers.facebook.com/docs/facebook-login/access-tokens/expiration-and-extension

An important note: Apps are unable to exchange an expired short-lived token for a long-lived token. The flow above only works with short-lived tokens that are still valid. Once they expire, your app must send the user through the login flow again to generate a new short-lived token.