I have a question in regards to the OAuth process. Here is my scenario:
I have a webhook app that I am hosting/running outside of Hubspot. This webhook receives payloads of data that then uses the Hubspot API to add contacts to the user’s Hubspot account (I have also created a Hubspot public app).
Here is the user flow:
- The user goes to the URL of the webhook (for demonstration purposes let’s say this URL is https://webhook.com).
- Once they have gone to that URL they are prompted to use OAuth to authorize their Hubspot account.
- Once the user has authorized my Hubspot app they are able to send payloads to my webhook’s endpoint (again, just for demonstration purposes here) https://webhook.com/endpoint.
- My webhook receives that payload and then updates the user’s Hubspot account by adding contacts to it.
This works; however my question is in regards to the OAuth portion. The OAuth token expires after a specific amount of time thus the user has to manually refresh it in order to have the webhook continue working. This is the issue I’m having.
How can I set my app up so that the user only has to authenticate with OAuth once? As this is a webhook I want it to be able to run in the background indefinitely after the user has given access to it (well until the delete/remove my Hubspot app from their account).
Thanks for your help!