我可以使用来自 office.js 的 bootstraptoken 静默获取 Graph 的 accesstoken 吗?

Can I use the bootstraptoken from office.js to silently get an accesstoken for Graph?

我有一个与 msal-angular@alpha 配合使用的 Office-js 插件。登录和注销工作正常,尽管只有一个帐户。我想使用已登录 Office 的用户并跳过帐户选择。

Office.js 提供了一个 OfficeRuntime.auth.getAccessToken() 给我一个 bootstrap 令牌。但是 Microsoft 的文档说我需要一个后端服务,该服务必须将 bootstrap 交换为访问令牌,以便与 MSgraph 一起使用 post 到 https://login.microsoftonline.com/common/oauth2/v2.0/token。这使得 bootstrap 令牌感觉像某种 refresh_token 但它似乎不是。

@azure/msal-angular 可以帮忙吗?我可以将 bootstrap 令牌提供给 msal 以某种方式让用户获得适当的 acces_token 以便加载项可以访问他的共享点站点(图形端点)吗?

使用 bootstrap 令牌访问 Microsoft Graph 的唯一方法是将其交换为 Graph 访问令牌。您必须与需要服务器到服务器交互的“代表”流程进行交换,因此您无法避免后端。