【发布时间】:2020-09-25 19:22:14
【问题描述】:
我有一个 node.js 应用程序,我正在尝试使用 PnPjs 的 AdalFetchClient 从共享点获取一些数据。
sp.setup({
sp: {
baseUrl: "https://placeholder.sharepoint.com",
fetchClientFactory: () => {
return new AdalFetchClient("tenantId", "azure_clientId", "azure_clientSecret");
},
},
});
await sp.web.getAppCatalog().get();
我收到此错误:Error making HttpClient request in queryable [401] Unauthorized ::> {"error_description":"Invalid issuer or signature."}
我像这样设置我的 azure Active Directory 应用程序的权限: Azure App permissions
我已将所有权限授予我尝试从以下位置获取数据的租户: Granted permissions to Azure App
我使用的例子在这里:https://pnp.github.io/pnpjs/nodejs/adal-fetch-client/ 我还尝试将 AdalFetchClient 与图形一起使用。这是有效的。好像只有sharepoint api有问题。
【问题讨论】:
-
您是否通过以下方式在 Azure AD 应用中配置了自签名 X.509 证书:docs.microsoft.com/en-us/sharepoint/dev/solution-guidance/…?
-
其实我没有!感谢您提供此资源。你知道如何将证书添加到 pnp-js 的 AdalFetchClient 中吗?老实说,我真的不想使用 powershell。 :D
-
或者你知道如何将证书作为http头发送吗?
-
我不知道。我认为你应该遵循官方文档。
-
请继续发帖,让我知道它是否解决了您的问题。
标签: node.js azure sharepoint azure-active-directory pnp-js