citronic
citronic

Reputation: 10168

Anyone Know the Lifespan of a Facebook API Access Token?

what is the lifespan of an access token in the FB oAuth API?

Not the extended offline permissioning, just a normal access token?

Upvotes: 3

Views: 1513

Answers (2)

Douglas Purdy
Douglas Purdy

Reputation: 1009

User access token expiry is returned when the access token is issued (you see it appended to the end of the access_token). It is currently 2 hours, but that is subject to change. The key thing to remember is that access token can become invalid for a number of reasons and you need to make sure that you are prepared to handle that case. See the how-to for this at: https://developers.facebook.com/blog/post/500

App access tokens have no expiry right now, but I expect that we are going to change that and you should also be prepared to handle the case where this token becomes invalid.

Upvotes: 5

Rebecca Chernoff
Rebecca Chernoff

Reputation: 22615

If you don't specify the offline permission, then the token is only valid while the user is signed in to Facebook and only until the expiry that gets passed back to you passes. I think it is somewhere around 2 hours generally but I haven't verified it. You can find more information from Facebook's documentation.

http://developers.facebook.com/docs/authentication/

Upvotes: 5

Related Questions