gpt4 book ai didi

azure - 首次登录 Outlook 加载项时,用户同意提示不显示所有 list 范围权限

转载 作者:行者123 更新时间:2023-12-03 03:23:05 26 4
gpt4 key购买 nike

我正在开发一个需要 Mail.ReadWrite 权限的 Outlook 插件。

我已在我的租户(租户 A) 的 Azure 注册应用中添加了此权限。

azure grant

我还将它们添加到 manifest.xml 文件中

<Scopes>
<Scope>Mail.ReadWrite</Scope>
<Scope>offline_access</Scope>
<Scope>User.Read</Scope>
<Scope>profile</Scope>
<Scope>openid</Scope>
</Scopes>

以下是我如何调用登录提示(使用 Office.js 库)

const token = await OfficeRuntime.auth.getAccessToken({
allowConsentPrompt: true,
allowSignInPrompt: true,
forMSGraphAccess: true,
});

然后我正在与第二个租户进行测试。

tanant B 中的用户安装加载项并首次运行应用时。出现弹出同意窗口

consent

在这里我没有看到应用请求的所有权限。

当我尝试获取图形 API 数据时,这会导致问题。我收到此错误:

'AADSTS65001: The user or administrator has not consented to use theapplication with ID '1bc20309-c580-40ad-8133-c0c2bd127807' named'summarizrApp'. Send an interactive authorization request for thisuser and resource.\r\nTrace ID:bb0919d6-3fbe-4a62-b5a3-7389b3da4100\r\nCorrelation ID:76194227-9c13-4292-9088-aac8a7d037f1\r\nTimestamp: 2023-06-0916:34:38Z'

当我在测试租户 B Azure 门户上登录企业应用程序时,我看到该应用已添加。

但我注意到并非所有权限都存在,只有 profileopenidoffline_access 而不是 Mail.ReadWriteUser.Read

enter image description here

但是这些权限不需要管理员授予。

并且仅当我单击“授予管理员同意”(在租户 B Azure 门户的企业应用程序中)时,才会添加缺少的权限并且图形调用可以正常工作。

enter image description here

然后

enter image description here

同意后:

enter image description here

缺少的权限在这里!

我期望的行为是在同意用户窗口中用户获得所有权限。一旦他授予它们,Outlook 加载项应该能够代表用户调用该图表。

Authenticate a user with a single-sign-on token in an Outlook add-in

最佳答案

租户管理员需要提供一次同意,您可以在安装应用程序时这样做。否则,用户首次登录时将被要求这样做。

关于azure - 首次登录 Outlook 加载项时,用户同意提示不显示所有 list 范围权限,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/76442303/

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