带有图形 API 的 Outlook Web 插件 [英] Outlook web Addins with graph api
问题描述
我正在尝试制作 Outlook Web 插件并希望在其中使用图形 API,如 SSO 文章 他们提到AppSource 不接受使用 SSO 的加载项".想知道如何获取基于用户的图形令牌以访问 Outlook 加载项中的图形 API.
I am trying to make Outlook web add-ins and want to use graph api in that, as on SSO article they mention this "add-ins that use SSO are not accepted in AppSource". Want to know how to get user based graph token to access the graph api in outlook add-ins.
我使用 msal js 身份验证流程来验证用户 这里是链接.当此代码在 chrome 登录弹出窗口中运行时,会被浏览器阻止,而在 IE/EDGE 登录弹出窗口中由于跨域无法显示.
I used msal js auth flow for authenticating user here the link. When this code runs in chrome login popup get block by browser and in IE/EDGE login popup doesn't show off due cross domain.
此外,在 chrome 中允许弹出窗口后,我能够获得Id 令牌",但 acquireTokenSilent(requestObj)
没有给出任何响应.有没有其他方法可以让我在 Outlook Web 加载项中获取图形访问令牌.最后是 AppSource 上的完整加载项部署过程.
Also after allowing popup in chrome i am able to get "Id Token" but acquireTokenSilent(requestObj)
doesn't give any response.
Is there any other method by which i can get graph access token in outlook web add-ins.
And last the complete add-ins deployment process on AppSource.
EDGE Error:
Error: SEC7120: [CORS] The origin 'https://outlook.office.com' failed to allow a cross-origin document resource at
'ms-appx-web://microsoft.microsoftedge/assets/errorpages/forbidframingedge.htm#https://login.microsoftonline.com/common/oauth2/authorize?response_type=id_token&client_id=89bee1f7-5e6e-4d8a-9f3d-ecd601259da7&redirect_uri=https%3a%2f%2fwebshell.suite.office.com%2fiframe%2fTokenFactoryIframe&state=2fd6785e-ad7d-4ba6-b388-f258ee72a0e3&client-request-id=d5ebe7a0-d47e-4f80-b6c3-c92151ad9801&x-client-SKU=Js&x-client-Ver=1.0.15&nonce=f8d6d0af-fcd0-41e2-b13f-cdd5081c4426&sso_nonce=AQABAAAAAAAP0wLlqdLVToOpA4kwzSnx_gNC04Yd8tQjotaaeZcmU-owjoPhrd8CGajva7JsLfGXbPo3Z4L-ij10hP0Ad2GUJyn8ZLnhiEhRZSHOQh-GdCAA&mscrid=d5ebe7a0-d47e-4f80-b6c3-c92151ad9801'.
推荐答案
您可以通过 getCallbackTokenAsync() 方法获取使用 Outlook REST API 的令牌.
You can obtain a token for using Outlook REST APIs using the getCallbackTokenAsync() method.
检查以下文档:使用 Outlook REST来自 Outlook 加载项的 API.
这篇关于带有图形 API 的 Outlook Web 插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!