3

I am trying to integrate Facebook into my CMS. I have downloaded the SDK for PHP and I have successfully made the requests to generate an access token and have used it to post to the facebook page. All works great, however it says the access token is only valid for 2 months.

I can't have users manually re-generating access tokens after two months, and I have read about Never Expires access tokens for this. All the links I've seen so far are out dated and no longer apply to the current dashboard when I log in and look at my facebook app. Facebook SDK I'm using is 5.3.

How can I create a never expires facebook access token so I can have this as part of my cms without users having to re-generate access tokens (click the OK permissions dialog, etc) every 2 months?

Please help.

UPDATE

Just found this post...when I do this it does change the expires attribute on the token each time. So I guess this is a valid way to do it?

Generate "never-expire" access token for Facebook Page

Community
  • 1
  • 1
Phil
  • 4,029
  • 9
  • 62
  • 107

1 Answers1

6

There is no User Token that is valid forever. 2 months is the maximum. Refreshing a User Token is only possible with user interaction.

Only App Tokens and Extended Page Tokens are valid forever.

More information:

andyrandy
  • 72,880
  • 8
  • 113
  • 130
  • 1
    How do I create an Extended Page Token? I just want to post to my facebook page from PHP without having to refresh the access token every two months. How is this possible? – Phil Sep 30 '16 at 17:29
  • 1
    just take a look at the links in my answer, it is explained very well how to create an extended page token. – andyrandy Oct 01 '16 at 07:01
  • 2
    why the downvote? please comment if something is wrong with the answer. – andyrandy Oct 06 '17 at 11:30
  • I didn't downvote your answer, so I'm not sure who did. – Phil Oct 06 '17 at 17:25