Office-addin-sso 与 @azure/msal-browser
是否可以将 office-addin-sso 与 @azure/msal-browser 一起使用?
我想:
- 使用 OfficeRuntime.auth.getAccessToken() 来获取身份令牌。
- 同时使用 @azure/msal-browser 作为后备 方法。
我已成功实现上述两项工作,并且仅使用 @azure/msal-browser 即可成功获取 MS Graph 访问令牌。
鉴于我们希望使用带有 PKCE 的 msal-browser/auth 代码流(而不是 msal/隐式流)进行回退,在此获取 MS Graph 访问令牌的最有效方法是什么语境。
考虑到 office-addin-sso 包使用代表流程(需要机密和重定向)。
任何帮助/建议或指导将不胜感激。
Is it possible to use office-addin-sso with @azure/msal-browser ?
I would like to:
- use OfficeRuntime.auth.getAccessToken() to get the Identity Token.
- while at the same time use @azure/msal-browser as the fallback
method.
I have managed to get both the above working and can successfully get the MS Graph access token using just @azure/msal-browser.
Given that we want to use msal-browser/auth code flow with PKCE (and not msal/implicit flow) for the fallback, what would be the most effective way of getting the MS Graph access token in this context.
and given that the office-addin-sso package uses On Behalf Of Flow (requiring a secret and redirect).
Any help/suggestions or guidance would be really appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在
office-addin-sso
中使用@azure/msal-browser
。我的插件适用于单个域,用户应该在 OneDrive 上登录,因此我希望永远不需要通过后备登录。我从 msal 静默获取令牌,然后将其传递给 MS graph 以获取访问令牌。这是在ssoauthhelper.ts
中执行此操作的代码:I use
@azure/msal-browser
in theoffice-addin-sso
. My addin is for a single domain and the users are supposed to be logged in on OneDrive so I expect to never need the login via the fallback. I get the token silently from msal and then pass it to MS graph to get an access token. This is the code that does it in thessoauthhelper.ts
: