While I didn’t use Pathfix, I did manage to set up Oauth with Glide + Make.
Use case:
Allow my users to connect their own HubSpot accounts to their profile in my Glide project. This allows each user to pull in data that’s relevant to their business (ie contacts, deals, etc). You could do this for any platform.
High-level steps:
- Create a new Make scenario with the first module being a Custom Webhook.
- Copy the webhook URL and use it as the Redirect URL in the platform you’re setting up OAuth in (HubSpot in this example). This will generate an Install URL.
- Copy this Install URL into a template column in Glide and add
&state=@
to the end of it. Then, replace ‘@’ with the RowID. This will ensure you can link the Oauth back to your users/row in Glide. - Test the Install URL. It should send an authorization code to your Make scenario.
- Connect a HTTP (Make a Request) module to the first module (Webhook).
- In the HTTP module, send the authorization code received in the first module to the platform’s API and request the tokens. Refer to the platform’s API documentation for the specific API call.
- Connect a Data Store (Add/replace a record) to the HTTP module. Set
state
as the key from the webhook and record the Refresh Token and Access Token. - Optional: You can then use a HTTP module to send these tokens back to Glide.
Oauth tokens only last around 30 minutes before they expire, so we need a way to refresh them:
- Create a new Make scenario with a Data Store (Search Records) module as the first step. Configure it to use your data store and filter by
Refresh Token Exists
. - Connect an Iterator module if you have multiple tokens to refresh.
- Connect a HTTP module and send the Refresh Token to the platform’s API to request new tokens. Refer to the platform’s API documentation for the specific API call.
- Connect a Data Store (Update a record) module and set the key as the
state
. Map the HTTP’s output to update the relevant sections of your data store. - Set the first module to run every 29 minutes, daily, or whatever frequency you’d like. All done!
I’m sure there’s steps I’ve overcomplicated too. Would love to see how others refine this further!