Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Box with JWT (Server Authentication)

Tags:

jwt

box

I using Box API JWT Server Authentication:

        IAccessTokenCache accessTokenCache = new InMemoryLRUAccessTokenCache(100);

        Reader reader = new FileReader("D:\\config.json");
        BoxConfig boxConfig = BoxConfig.readFrom(reader);


        BoxAPIConnection api = BoxDeveloperEditionAPIConnection.getAppUserConnection(USER_ID,boxConfig);

but the Box exception:

{"error":"unauthorized_client","error_description":"This app is not authorized by the enterprise admin"}

enter image description here

like image 741
virmeidec Avatar asked May 06 '17 02:05

virmeidec


2 Answers

@kendomen is correct. Here's some more detail:

Go to api.box.com. Then select Admin Console.

enter image description here

Now this is where it gets funky. Click on the Security step.

enter image description here

Then the fine print.

enter image description here

This gives the tool bar that should have been displayed three steps ago. Click Apps.

enter image description here

Then click on Authorize New App.

enter image description here

This puts up a pop-up where you enter the app key. This is referred to as the "ClientID" in the json file you may have downloaded from Box.com.

enter image description here

like image 135
Karl Hoaglund Avatar answered Oct 10 '22 23:10

Karl Hoaglund


The admin of Box has to go to Admin Console -> Enterprise Settings -> Apps and authorize your app.

like image 7
kendomen Avatar answered Oct 10 '22 23:10

kendomen