codefog / contao-instagram

Contao extension that displays Instagram feed on your website
MIT License
11 stars 12 forks source link

Access token refresh #20

Closed rhymeadam closed 4 years ago

rhymeadam commented 4 years ago

Hi guys—very nice improvement to this extension! After reviewing the code, I'm wondering if the long-lived access token will simply expire after 60 days, or will it remain valid? I don't see any functionality built in here to reresh the access token, so I'm worried about leaving this on a client's site for more than a couple of months. Thoughts?

Toflar commented 4 years ago

Hey Adam, as far as I know the token validity is just extended every time the user makes a request to the servers of FB. I'm not sure if that means the app kind of self extends the validity or if that means the user that authorized the app has to log in regularly (so not with the app) within 60 days.

It's described here: https://developers.facebook.com/docs/facebook-login/access-tokens/refreshing/

rhymeadam commented 4 years ago

Okay, I'll just keep an eye on it for now. Thank again!

rhymeadam commented 4 years ago

Hi guys, it looks like this actually is an issue where the backend user will have to refresh the access token every 60 days by resaving the module and making sure the "Request access token and update feed" checkbox is checked. Is there anything you can build into this to make it so it'll refresh the access token on its own? Thanks in advance!

sgn-dev commented 4 years ago

If I click the "Refresh token" checkbox in the module and save the data record, nothing happens.

So even if the backend user updates every 60 days, the module does not work for me

qzminski commented 4 years ago

@rhymeadam I have added token auto-refresh in 2.1.3 which has been just released. Please try it out.

@SgnAtWork please make sure the token changes. Also please check if there is any relevant information in the system logs in Contao backend.