'Unauthorized' 从 Microsoft Graph 请求 'https://graph.microsoft.com/v1.0/me/joinedTeams' 时出错
'Unauthorized' error when requesting 'https://graph.microsoft.com/v1.0/me/joinedTeams' from Microsoft Graph
我正在尝试通过授权在邮递员中访问 https://graph.microsoft.com/v1.0/me/joinedTeams,我得到的响应是
{ “错误”:{
"code": "未经授权",
"message": "未经授权",
“内部错误”:{
“日期”:“2020-08-01T09:39:59”,
“请求 ID”:“d906f428-ffcd-4821-9153-f9b1976e74c1”
} } }
如文档中所述,我已设置范围 Team.ReadBasic.All TeamSettings.Read.All TeamSettings.ReadWrite.All User.Read.All User.ReadWrite.All Directory.Read.All Directory.ReadWrite.All Group.Read.All Group.ReadWrite.All ChannelMessage.Send
In the Enterprise applications, I'm having Microsoft teams installed
I have added the API permissions for type Delegated
但我可以访问个人资料和群组。每当我尝试访问团队 API 时,我总是收到 Unauthorized 消息。谁能告诉我,我错过了什么?
我注意到您没有为您的租户授予管理员许可。您应该使用 Azure AD 管理员帐户来执行此操作。 Status 将变为“Granted for {your tenant}”。
您应该参考Get access on behalf of a user使用授权代码流程获取访问令牌。
我正在尝试通过授权在邮递员中访问 https://graph.microsoft.com/v1.0/me/joinedTeams,我得到的响应是
{ “错误”:{ "code": "未经授权", "message": "未经授权", “内部错误”:{ “日期”:“2020-08-01T09:39:59”, “请求 ID”:“d906f428-ffcd-4821-9153-f9b1976e74c1” } } }
如文档中所述,我已设置范围 Team.ReadBasic.All TeamSettings.Read.All TeamSettings.ReadWrite.All User.Read.All User.ReadWrite.All Directory.Read.All Directory.ReadWrite.All Group.Read.All Group.ReadWrite.All ChannelMessage.Send
In the Enterprise applications, I'm having Microsoft teams installed
I have added the API permissions for type Delegated
但我可以访问个人资料和群组。每当我尝试访问团队 API 时,我总是收到 Unauthorized 消息。谁能告诉我,我错过了什么?
我注意到您没有为您的租户授予管理员许可。您应该使用 Azure AD 管理员帐户来执行此操作。 Status 将变为“Granted for {your tenant}”。
您应该参考Get access on behalf of a user使用授权代码流程获取访问令牌。