Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook app (NOT user) access token expiration

Tags:

Do Facebook APP access tokens expire? These tokens are different than the USER tokens; they are acquired like this:

https://graph.facebook.com/oauth/access_token?grant_type=client_credentials&client_id={0}&client_secret={1}) 

as described in the App Login section of the document at http://developers.facebook.com/docs/authentication/.

Are there any circumstances under which they will become invalid?

NB: This is NOT a question about USER access tokens (which are clearly documented). There was an identical question http://facebook.stackoverflow.com/questions/7322063/does-app-login-access-token-expire wrongly closed as duplicate of another question about USER access tokens.

like image 277
eugen Avatar asked Jan 25 '12 20:01

eugen


People also ask

Do Facebook app access tokens expire?

These tokens are refreshed once per day, when the person using your app makes a request to Facebook's servers. If no requests are made, the token will expire after about 60 days and the person will have to go through the login flow again to get a new token.

How do I get Facebook access token that never expires?

If you want to make sure your Facebook page access token never expires, click “Debug” button. If you can see “expires: never”, it means Facebook page access token will never expire.

How do I handle access token expiry?

When the access token expires, the application can use the refresh token to obtain a new access token. It can do this behind the scenes, and without the user's involvement, so that it's a seamless process to the user.

How can I extend my Facebook access token?

Extend Access TokenCopy your token. Paste it in the text box on the Access Token Debugger. On the Access Token Debugger, scroll all the way down to the bottom of the page. Click Extend Access Token to get a long-lived token.


2 Answers

Per the Facebook documentation:

An App Access Token is signed using your app secret and will not expire; it will be invalidated if you re-key/reset your application secret.

like image 105
David Knell Avatar answered Sep 23 '22 10:09

David Knell


Creating an APP_ACCESS_TOKEN is really easy. You can use your App ID/API Key and App secret

access_token = YOUR_APP_ID|YOUR_APP_SECRET 

Example: 1234587968 | bghyuifjk3438483249235903502035023504305

like image 26
tildy Avatar answered Sep 22 '22 10:09

tildy