gpt4 book ai didi

azure - 为 Outlook 生成 token 然后与 graphapi 交换时出现格式错误

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

当我尝试在 Outlook 中为用户生成访问 token ,然后为图形 Api 交换访问 token 时,它失败并出现格式错误的错误。

为了生成访问 token ,我传递了这些值

enter image description here

完整错误是:

   {
"error": "invalid_grant",
"error_description": "AADSTS9002313: Invalid request. Request is malformed or invalid.\r\nTrace ID: ba68002d-e58b-4d65-9e61-6e5ca2845500\r\nCorrelation ID: 03ee058c-38cb-407d-9b88-f51b7c992464\r\nTimestamp: 2022-10-19 15:05:17Z",
"error_codes": [
9002313
],
"timestamp": "2022-10-19 15:05:17Z",
"trace_id": "ba68002d-e58b-4d65-9e61-6e5ca2845500",
"correlation_id": "03ee058c-38cb-407d-9b88-f51b7c992464",
"error_uri": "https://login.microsoftonline.com/error?code=9002313"
}

我在同意的情况下授予了这些权限

enter image description here

该错误意味着授权类型错误或端点无效?或者我缺少任何权限吗?请帮我解决错误

最佳答案

我尝试在我的环境中重现相同的情况,但得到了如下相同的错误:

enter image description here

如果code参数值无效,通常会发生此错误。确保使用以下端点生成 code 值:

https://login.microsoftonline.com/TenantId/oauth2/v2.0/authorize?
&client_id=e626f30a-80ea-*********-******
&response_type=code
&redirect_uri=https://jwt.ms
&response_mode=query
&scope=user.read openid profile offline_access email mail.read
&state=12345

enter image description here

当我传递上述 code 值时,我能够成功生成访问 token ,如下所示:

GET https://login.microsoftonline.com/TenantID/oauth2/v2.0/token 

client_id:clientid
client_secret:clientsecret
grant_type:authorization_code
code:code
scope:email Mail.Read offline_access openid profile User.Read
redirect_uri:RedirectUri

enter image description here

关于azure - 为 Outlook 生成 token 然后与 graphapi 交换时出现格式错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/74160776/

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