Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generate "never-expire" access token for Facebook Page

Tags:

facebook

I have managed to post to Facebook Page via API (C#), but when administrator of the page logs out, the following error occurs:

"(OAuthException - #190) Error validating access token: The session is invalid because the user logged out."

How do I generate access token which is never expired?

I need a solution that doesn't open Facebook Login dialog.

like image 583
Ivan Studenikin Avatar asked Jul 02 '13 12:07

Ivan Studenikin


People also ask

How do I get Facebook access token that never expires?

In the Access Token Debugger that will open up, click on the 'Extend Access Token' button at the bottom of the page. A new access token should be displayed and the text above it should say that it never expires.

How long do Facebook access tokens last?

When your app uses Facebook Login to authenticate someone, it receives a User access token. If your app uses one of the Facebook SDKs, this token lasts for about 60 days. However, the SDKs automatically refresh the token whenever the person uses your app, so the tokens expire 60 days after last use.


1 Answers

You can generate never expiring access token without coding, following this instructions:

  1. Open graph Explorer: https://developers.facebook.com/tools/explorer/.
  2. Choose your application from the right corner dropdown.
  3. From "Get Token" dropdown choose your Fan Page.
  4. Click on submit button to generate token.
  5. From the left side on "Search for a field" enter access_token and click submit again. Copy this token from the main window.
  6. Open https://developers.facebook.com/tools/debug/accesstoken and paste token here. Click "Debug".
  7. Click the button "Extend Access Token". This will generate never expiring token.
like image 112
Mile Janev Avatar answered Sep 29 '22 16:09

Mile Janev