Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Chris Lagasse

    (@soben)

    Imran,

    Unfortunately that isn’t something I can fix. This is a limitation on the part of HubSpot…

    The oAuth authentication token from HubSpot is only valid for 8 hours.

    We use WordPress’s CRON to request a new authorization token before these 8 hours are up. Unfortunately, WordPress’s CRON requires a user to visit your website… So if you go more than 8 hours without a visitor visiting the site, there is absolutely nothing I can do about it, and the token expires.

    A current in-place work around it is by not using oAuth, and using the “API Key” method instead. You can get an API key by going here: https://app.hubspot.com/keys/get

    It’s frustrating and I wish there was a way around this with oAuth, but there isn’t. The only other way I can work around this is by building a CRON that can run on your server, but that requires an extra admin step (cPanel, Plesk, etc), that most WordPress users aren’t familiar yet, and potentially don’t even have access to. I will consider adding it in the future, at least so it’s an option that’s available.

    -Chris.

    Plugin Author Chris Lagasse

    (@soben)

    I am double checking that the API Key method works right now, and if it doesn’t, I’ll push a fix momentarily.

    Plugin Author Chris Lagasse

    (@soben)

    Download the latest version (1.3) and use the method I mentioned above (API Key)… it doesn’t have the same oAuth expiration token limit.

    Had issues with API Key method (I hadn’t touched it in so long due to implementing oAUth), so I had to push a fix for it. 🙂

    Let me know if this solves your problem. Marking it resolved on Monday, unless you have issues.

    Thread Starter Imran Kabir

    (@imrankabir-1)

    Soben,

    Thanks for your reply.
    we have access to the server and we can set CRON Jobs. Now I just want to confirm the function which needs to set in CRON Jobs, I have found a function in class bsdGFHubspotBase named getOAuthTokenArray(); in gravityforms-hubspot-live/library/base.php which I think will work if I setup CRON Jobs for this function. Am I on right function?

    Thanks

    Plugin Author Chris Lagasse

    (@soben)

    Imran,

    That script won’t technically work right now as a cron job. The file itself doesn’t have WordPress prepared for it (it’s meant to run as part of the larger WordPress package)

    Hence why I said I will have to create a special function/file for this purpose. I’ll try to spend some time today working on this for you.

    -Chris.

    Plugin Author Chris Lagasse

    (@soben)

    there’s a cron file in the includes folder of this plugin now.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Hubspot needs Authorized again and again!’ is closed to new replies.