我正在尝试使用 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-"
}
最佳答案
关于onedrive - 图形API : Either scp or roles claim need to be present in the token,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35839675/