• Resolved luuklag

    (@luuklag)


    Every few days my authentication token expires. Which results in images not being loaded on my site. I followed the manual, and it worked fine in the beginning. Now as I add more and more galleries the succesion of token expiries increases. Every few days I have to authenticate again, loging in to google, give permission, get the token and save it. Only to repeat a few days later.

    I am now at a point that I have to check my site regularly to see if the plug-in is still working, which is frustrating. Anyone else had these problems and knows a fix?

Viewing 15 replies - 1 through 15 (of 21 total)
  • Plugin Author Sayontan Sinha

    (@sayontan)

    The only platform for which tokens expire is Instagram. Facebook expires Instagram tokens after 60 days and does not allow applications to automatically refresh them without the users explicitly granting access. This behaviour was introduced roughly in September or October last year.

    No other platform has this issue. You have not specified which platform you are using, but if you are facing this problem on Google Photos, your problem is elsewhere, and probably not even related to authentication. Google Photos does not work with caching plugins – all their URLs have a short lifespan, so if you cache them, they will become invalid after 35 minutes.

    Thread Starter luuklag

    (@luuklag)

    Well this hapens on Google photo’s for me. Every now and then it also bugs me about my app (that was created in the registery proces you outlined) being in beta and untrusted.

    Plugin Author Sayontan Sinha

    (@sayontan)

    Can you provide me with a URL? Are you using any sort of caching setup?

    Thread Starter luuklag

    (@luuklag)

    It’s https://www.betuwekids.nl The galleries are just simply inserted, nothing set about caching that I know of.

    Plugin Author Sayontan Sinha

    (@sayontan)

    Is it possible that you have caching set at a server level (not by WordPress)? This is generally configured in the server’s .htaccess file, and might even have been set up by your host. Sometimes servers have different cache expiry settings – if your HTML output has a long cache expiry, that will cause problems.

    Try this: go to Photonic → Settings → Generic Options → Advanced, and for “Loading Mode” set it to JavaScript. This might help bypass HTML caching by your server.

    As I said, there is nothing in the Google Photos setup that will require you to reauthenticate. The Google setup is a one-time activity – I haven’t had to reauthenticate since September 2018!

    Next time you face this issue, try this: rather than redoing your authentication, try saving a post where you are getting this error without making any changes. If simply saving the post fixes this, it would confirm my theory about server level caching.

    Plugin Author Sayontan Sinha

    (@sayontan)

    Also, if this happens over the next few days, please let me know once without changing anything – I can check to see what is happening. I am based out of the US, so please keep that in mind with respect to my response time (I respond within a few hours of receiving a support request when I am awake).

    Thread Starter luuklag

    (@luuklag)

    Hi Sayontan,

    It is happening again right now. The galleries are all replaced with:

    https://i.stack.imgur.com/6bZGM.png

    Editing, without changing anything, didn’t resolve the issue.

    Also google keeps asking if I want to trust the app, every time I re-authenticate. Something I don’t see mentioned in your instructions. So perhaps there is something in the google apps settings?

    • This reply was modified 3 years, 9 months ago by luuklag.
    • This reply was modified 3 years, 9 months ago by luuklag.
    Thread Starter luuklag

    (@luuklag)

    Turned out I didn’t publish my “google app”. I did now, so hopefully this is solved.

    Plugin Author Sayontan Sinha

    (@sayontan)

    It is happening again right now. The galleries are all replaced with:

    https://i.stack.imgur.com/6bZGM.png

    Editing, without changing anything, didn’t resolve the issue.

    Interesting – this seems to be an altogether different type of error, and is very puzzling. Google Photos’ refresh tokens never expire, but your error is saying that your token has expried:

    {
      "error": "invalid_grant",
      "error_description": "Token has been expired or revoked."
    }

    The only way they would expire is if you revoke access yourself in Google. Normally this happens if you do a privacy check in Google and disable some access. Do you have some sort of a setting in your Google account that deactivates access periodically?

    Also google keeps asking if I want to trust the app, every time I re-authenticate. Something I don’t see mentioned in your instructions. So perhaps there is something in the google apps settings?

    Don’t worry about that. You are authorizing your own Client ID, not someone else’s Client ID. I have this covered in my documentation. Refer to point #3 in the Authentication section.

    We are seeing the same on our dev site. It had been working for a few days. Any resolution?
    https://mws2020.wpengine.com/ontario-resort-photos-videos/ontario-bass-fishing-photos/

    Tried the Javascript setting solution and that did not change anything. Did the save page solution and that did not do anything. It has happened twice now. There’s nothing in htaccess that would effect this.

    “Google Photos Refresh Token invalid. Please authenticate from Photonic → Authentication.
    Error encountered during authentication:
    {
    “error”: “invalid_grant”,
    “error_description”: “Token has been expired or revoked.”
    }
    See here for documentation.”

    THanks!

    Plugin Author Sayontan Sinha

    (@sayontan)

    @muskie73,
    Have you tried publishing your app, like the OP did to make it work?

    It is published, it had been in testing, but after publishing it did not change anything on my end. Does this take time to take effect?

    Plugin Author Sayontan Sinha

    (@sayontan)

    You will need to authenticate at least once after making the app public.

    OK
    Thanks, will try

    Re-authenticating after publishing the app did the trick! Thanks!

Viewing 15 replies - 1 through 15 (of 21 total)
  • The topic ‘Keep needing to verify my api token’ is closed to new replies.