Java SDK Downscope to Folder - unable to determine resource typeAnswered
I am attempting to use Token Exchange with the Box Java SDK to be used with the Content Picker UI element. I would like to limit my users to have access to a single folder based on custom user variables from my website. However, whenever I try downscoping the access token to a folder resource I get:
com.box.sdk.BoxAPIException: Unable to determine resource type: https://api.box.com/2.0/folders/... at com.box.sdk.BoxAPIConnection.getLowerScopedToken(BoxAPIConnection.java:785)
I investigated the getLowerScopedToken function and it seems like it only accounts for file resources, not folders. In determineResourceLinkType(), the only endpoint patterns addressed are for files and links with no /folders/ endpoint.
I see here that it's possible to downscope to a folder with cURL.
Is it possible to downscope to a specific folder with the Java SDK? Do I need to do the POST request from scratch? Is that allowed?
This was fixed in this release, so as long as you are using vs v2.50.1 or higher it should be there!
Alex, Box Developer AdvocateComment actions
It works now, thanks so much. Btw you should probably update the version listed here: http://opensource.box.com/box-java-sdk/.
Please sign in to leave a comment.