Developer token works great, but I need a permanent solution. I'm building a personal site and just need to read the items in the folder, don't need any user authentication.
When I try using cliend id and secret
this.api = new BoxAPIConnection(clientID, clientSecret);
I get this exception:
Exception in thread "main" com.box.sdk.BoxAPIResponseException: The API returned an error code [401 | .0e*******]
at com.box.sdk.BoxAPIResponse.<init>(BoxAPIResponse.java:92)
at com.box.sdk.BoxAPIRequest.trySend(BoxAPIRequest.java:675)
at com.box.sdk.BoxAPIRequest.send(BoxAPIRequest.java:381)
at com.box.sdk.BoxAPIRequest.send(BoxAPIRequest.java:348)
at com.box.sdk.JSONIterator.loadNextPage(JSONIterator.java:75)
at com.box.sdk.JSONIterator.loadNextJsonObject(JSONIterator.java:97)
at com.box.sdk.JSONIterator.hasNext(JSONIterator.java:32)
at com.box.sdk.BoxItemIterator.hasNext(BoxItemIterator.java:28)
at servicesHttpConnect.boxConnect.findFileBoxItemObject(boxConnect.java:114)
at servicesHttpConnect.boxConnect.itemsInFolder(boxConnect.java:95)
at servicesHttpConnect.boxConnect.main(boxConnect.java:131)
(My app is authorized in the admin console) So how can I log in to box? Thanks!