Take the 2-minute tour ×

I have been working with Facebook OAuth 2.0 using JavaScript SDK. I saw that Facebook has recently changed the "infinite" expiration time access token feature and now one has gets an Access token for offline access which is valid only for 60 days maximum.

I tried the following code:

FB.init({appId: 'XXXXXXXXXXXX', oauth: true , secret: 'XXXXXXXXXXXXXXXXXXXXXXXXX' });
// the real values of appId and secret are not displayed for obv reasons

}, {scope: 'read_stream,publish_stream,offline_access'});

In my response: response.authResponse, I receive an access token and a value : expiresIn which is more or less around 6000. I don't understand what this value signifies. if I divide it by 3600, I would say it gives me around 2 hours of validity which means this is not an access token with infinite expiration time. Is there a way I can request for an access token with longer validity? Kindly let me know what I am doing wrong.

share|improve this question
add comment

1 Answer

I think this policy change is confusing right now because they are changing this today.
Till the new policy applies, you might need to change your app configuration as described here.
I guess you have to check your "deprecate offline_access"" setting.
As long as offline_access is not given and new policy is not applied, access_token usually expires in 2 hours.

share|improve this answer
add comment

Your Answer


