gpt4 book ai didi

azure - 为输入值范围提供的值对于 OnlineMeeting.ReadWrite 无效

转载 作者:行者123 更新时间:2023-12-03 06:31:16 25 4
gpt4 key购买 nike

我正在尝试代表用户创建 session ,因为我正在尝试获取代码。我已在 Azure 上注册了该应用程序。还生成了应用程序(客户端)ID 我还在 API 中添加了所需的权限。但是,当我访问此页面时,页面会要求提供电子邮件 ID,但一旦用户填写了电子邮件 ID,它就会显示“输入值范围提供的值对于重定向 URL 中的 OnlineMeeting.ReadWrite 无效”。

enter image description here

我在这里缺少什么?

编辑 1

按照@Rukmini的建议,我尝试了这个,这里是相关细节。

要获取我正在构建的代码,如下图所示:

enter image description here

当我传递 OnlineMeetings.ReadWrite 范围时,这不起作用。但是当我通过 https://graph.microsoft.com/.default 作为它的工作范围,我能够验证并生成代码。然后我可以使用该代码来获取访问 token ,如下图所示。但使用此访问 token 我无法创建 session ,因为它没有本文档 https://learn.microsoft.com/en-us/graph/api/application-post-onlinemeetings?view=graph-rest-1.0&tabs=http 中所述的 OnlineMeetings.ReadWrite 范围。

enter image description here

如何为 OnlineMeetings.ReadWrite 范围生成代码和访问 token ,以便我可以代表用户创建 session ?

编辑

我按照 @Rukmini 的建议使用以下查询参数生成了授权 URL。

enter image description here

当我访问该链接时,我看到了一个登录屏幕,但由于我之前的错误,我看到了相同的屏幕。我在这里错过了什么吗?我需要验证我的应用程序吗?或者我是否必须只使用一些特定的 ID,就像我们在 GCP 和 AWS 中所做的那样?

enter image description here

最佳答案

我尝试在我的环境中重现相同的结果,并成功获得如下结果:

我创建了一个 Azure AD Multi-Tenancy 应用程序:

enter image description here

我向 API 权限授予了管理员同意,如下所示:

enter image description here

我使用以下端点生成了代码并通过浏览器授权:

https://login.microsoftonline.com/common/oauth2/v2.0/authorize?
&client_id=ClientID
&response_type=code
&redirect_uri=https://jwt.ms
&response_mode=query
&scope=OnlineMeetings.ReadWrite
&state=12345

enter image description here

现在,我使用以下参数生成了访问 token :

https://login.microsoftonline.com/common/oauth2/v2.0/token

client_id:ClientID
client_secret:ClientSecret
scope:OnlineMeetings.ReadWrite
grant_type:authorization_code
redirect_uri:https://jwt.ms
code:code

enter image description here

使用 jwt.ms 解码访问 token 并检查范围是否为 OnlineMeetings.ReadWrite:

enter image description here

我能够使用以下查询成功创建在线 session :

https://graph.microsoft.com/v1.0/me/onlineMeetings
Content-Type: application/json

{
"startDateTime":"2023-01-12T14:30:34.2444915-07:00",
"endDateTime":"2023-02-12T15:00:34.2464912-07:00",
"subject":"User Token Meeting"
}

enter image description here

关于azure - 为输入值范围提供的值对于 OnlineMeeting.ReadWrite 无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/75221056/

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