gpt4 book ai didi

onedrive - 图形API : Either scp or roles claim need to be present in the token

转载 作者:行者123 更新时间:2023-12-02 19:21:30 25 4
gpt4 key购买 nike

我正在尝试使用 MS Graph API 从 OneDrive for Business 获取文件/文件夹列表。我已在 Graph Explorer 中成功执行了所需的查询,现在正在继续在我的项目中实现。

我的应用程序是 Windows 服务,因此我使用 this method 获取 token

我已成功检索到 token ,但是当我“获取”此 URL 时...//graph.microsoft.com/v1.0/users('someuseraccount')/drive/items/somedriveitem/microsoft.graph.createLink

...我收到带有错误的响应:

Either scp or roles claim need to be present in the token.

我的服务器的 token 响应如下:

{
"token_type": "Bearer",
"expires_in": "3600",
"scope": "Directory.AccessAsUser.All Files.Read Files.Read.Selected Files.ReadWrite Files.ReadWrite.AppFolder Files.ReadWrite.Selected profile Sites.Read.All User.Read",
"expires_on": "1457343736",
"not_before": "1457339836",
"resource": "https://graph.microsoft.com",
"access_token": "-the token-"
}

最佳答案

您的客户端应用程序似乎仅请求了对 Microsoft Graph 的委派权限,而应针对此处尝试的方案请求应用程序权限。下面是 Azure 门户中的应用程序权限部分的图示。请选择所需的适当权限并重试。 application permission illustration

关于onedrive - 图形API : Either scp or roles claim need to be present in the token,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35839675/

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