Accessing external services on behalf of a user inside SaaS application

adrigo

New member
Hi guys, I'm new to building SaaS, but have a technical background. However I'm wondering if anyone can tell me about best practices and the easiest way for accessing external services from inside a SaaS application on behalf for the user. In my example, I want users to log in and be able to see data from OneNote. I imagine you have to make API calls and use oAuth, but how would you go about implementing this efficiently, f.e. using a no-code tool like Softr.io . I'm looking for the least labor intensive way. Any help is appreciated!!
 
@adrigo so you authenticate with OAUTH, store their refresh token locally in your database and encrypt it.

You decrypt the refresh token whenever you need to make external calls on their behalf and you request an access token with the Refresh token and these typically last anywhere from 15 minutes to an hour.

Whenever an API request fails due to the Access Token expiring then you simply request another one and retry the request.

If the refresh token expires force them to reauthorize your app again by going through the OAUTH flow as if they were logging in.

That's pretty much it!
 
Back
Top