使用JWT与Box (服务器认证)

7

我正在使用Box API JWT服务器身份验证:

        IAccessTokenCache accessTokenCache = new InMemoryLRUAccessTokenCache(100);

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


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

但是Box异常:

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

enter image description here


您可以在此授权新的应用程序: https://app.box.com/master/custom-apps enter image description here - Thức Trần
2个回答

8

@kendomen是正确的。以下是更详细的说明:

前往api.box.com。然后选择Admin Console。

enter image description here

现在这里有些奇怪。点击Security步骤。

enter image description here

然后看一下小字。

enter image description here

这会显示应该在三个步骤之前显示的工具栏。点击Apps。

enter image description here

然后点击Authorize New App。

enter image description here

这会弹出一个窗口,在其中输入应用程序密钥。这在您可能从Box.com下载的json文件中被称为"ClientID"。

enter image description here


现在UI界面有一个轻微的变化,它现在位于“业务设置”下(https://monosnap.com/file/1GtysqvkwMh0gWsbpiRYnvswdGPw68.png)。 - katzmopolitan

7

Box的管理员需要前往管理控制台 -> 企业设置 -> 应用程序,并授权你的应用。


谢谢你的回复,我可以让您看一下如何创建应用程序并授权我的应用程序。 - virmeidec
在JWT应用程序列表中,如果您单击省略号,请选择“授权”。 - kendomen

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接