當試圖在Microsoft圖表中列出「我」的目錄項時,我收到400錯誤請求,並顯示以下錯誤消息:「缺少必要的用戶聲明。」Microsoft Graph無法列出目錄文件
重現步驟:
- 通過Application Registration Tool創建應用程序,授予權限
Files.Read
使用創建客戶端ID和客戶端密鑰來獲得令牌(以下其guide)捲曲:
curl -X POST -H "Cache-Control: no-cache" -H "Content-Type: application/x-www-form-urlencoded" -d 'grant_type=client_credentials&client_id=<client-id>&client_secret=<client-secret>=&resource=https://graph.microsoft.com' "https://login.microsoftonline.com/<my-tenant-id>/oauth2/token"
使用創建的
<Access-Token>
來製作一個要求列出根目錄像(捲曲):curl -X GET -H "Authorization: Bearer <Access-Token>" -H "Cache-Control: no-cache" "https://graph.microsoft.com/v1.0/me/drive/root/children"
獲取響應:
400 Bad Request
{
"error": {
"code": "BadRequest",
"message": "Missing necessary user claims.",
"innerError": {
"request-id": "36c384f4-1810-4d96-ad69-d69a67d11ece",
"date": "2016-05-31T14:39:05"
}
}
}
任何幫助,將不勝感激