Hi there,
I have two topics I'd like to inquire about which are related to each other.
Before that, a little background on what I'm trying to achieve - I'm building a Box integration which will include more than one service running simultaneously and collecting data from Box.
Now, my two concerns are:
- Which authentication flow should I use for getting access to users' content, while having different services accessing Box at the same time.
- How can I verify the permissions my application has been granted and essentially 'Test connection' after connecting to a user's account.
Now, as I understand my options are:
- Using 3-legged OAuth flow, which will provide me with a pair of access-refresh tokens after the user authorizes access. Using this approach I will have to share the access token between my services, and update all services after the token has been refreshed.
Using this approach I will create the developer application and define the scopes which the user will authorize, and so when I get the access token I know that the connection has been established. - Using JWT authentication flow with a Service Account, I will be able to generate as many tokens as my different services need. So no headache with populating the refreshed tokens to all of my services.
Using this approach each user account will have to use its own Service Account, and I plan on delegating the service account creation process to the user. In that case I will need to verify that the service account has the required permissions.
In any case, the user can revoke the access to the dev app at any time. How can I check efficiently that the connection hasn't been broken and that I can call the required APIs, without bumping into unauthorized errors?
Sorry for the long post, I'd really appreciate you help and insights.
Or