Hey all, Im in need of some help here
Im developing some features for a company intranet, this company uses Box with its employees for file sharing and storage.
What its needed
- users will have a widget inside the intranet to browse and download and upload files to their Box account (all managed accounts, already created and being used)
- since users are already logged in the intranet, they should not have to log in to Box or have to authorize it manually
Reading the docs, I figure what I need to do is to create an app with JWT auth and "Generate user access tokens" set to true, then I can use the generated access token to display a Box Content Explorer and a Box Content Uploader to the user to manage files from his account inside the intranet. This is possible, right?
Thing is, the backend is in PHP (the intranet is built in Wordpress), so no official SDK and the examples and docs are lacking
What I have to do, from what I understand:
1- authenticate with JWT (to that I can follow this helpful guide which even has PHP examples https://developer.box.com/docs/construct-jwt-claim-manually) to get an access token
2- make an API call to find the Box user by his/her email, so I can get the user Box ID
3- make a API call to "Generate a User Access Token" for the logged user
4- use that access token from 3 to load the Box Content Explorer and Box Content Uploader to the user
Problem is step 3: I have no idea how to do it. The examples in the docs (https://developer.box.com/docs/work-with-users#section-generate-a-user-access-token) are all using the SDKs, so not an option here. I cant find the method to do this on the API reference (https://box-content.readme.io/reference#token) or on the Postman collection
So, how do I generate a user access token without any of the SDKs? Is there any recipe, example or docs on that? Whats the API method used?
Thank you all