gpt4 book ai didi

excel - Microsoft Graph API 访问 Excel 文档权限

转载 作者:行者123 更新时间:2023-12-04 20:32:41 25 4
gpt4 key购买 nike

我正在深入研究 Microsoft Graph API,并希望使用它的功能与 Excel 工作簿进行交互。我打算创建一个与我的 API 接口(interface)的客户端应用程序,该 API 又与 Microsoft Graph API 接口(interface)。

我对 Microsoft Graph permission 感到困惑。文档。在筛选 Excel API 文档时,我看到为了 Update RangeGet Worksheet (或任何端点)我需要 Delegated (work or school account)允许。然后我查看了上面提到的 Graph 权限文档,它说:

Delegated permissions are used by apps that have a signed-in user present. For these apps either the user or an administrator consents to the permissions that the app requests and the app is delegated permission to act as the signed-in user when making calls to Microsoft Graph. Some delegated permissions can be consented to by non-administrative users, but some higher-privileged permissions require administrator consent.



对我来说,这读作“用户必须使用 oauth 登录才能通过 API 与工作簿进行交互”。我希望情况并非如此,因为我希望公开工作簿数据并拥有读/写权限。例如,我知道我必须对组织内的某些(管理员)用户进行身份验证才能检索/更新存储在 OneDrive 中的工作簿(通过 Graph API),但我只是想查看访问工作簿的要求。

最佳答案

看起来您打算将 Excel 工作簿用作中央源数据,而不是基于单个用户的存储。在这种情况下,您可以使用应用程序级别的同意访问 API,而无需用户登录。见 here .客户端“应用程序”将调用服务器(例如 nodeJs),然后该服务器将对 Microsoft Graph 进行 API 调用以与 Excel 工作簿进行交互。这个服务器到图形的调用是从客户端应用程序中抽象出来的,因此是安全的。

这种方法的缺点是您需要服务器实现,并且您无法实现不需要服务器端实现的单页应用程序。这不是一个大障碍——只是需要不同的设置。

关于excel - Microsoft Graph API 访问 Excel 文档权限,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47665932/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com