使用仅限应用的授权流程(无需登录)在 onedrive 上创建一个 folder/file,MSGRAPH

Create a folder/file on onedrive with app-only authorization flow (without signing in), MSGRAPH

我正在尝试使用仅限应用程序的授权流程在 OneDrive 上创建文件夹或文件,请求和响应详细信息如下,

POST https://graph.microsoft.com/v1.0/drive/root/children  
HTTP/1.1
Content-Type: application/json
Accept: application/json
AUTHORIZATION: Bearer <AccesToken>
Host: graph.microsoft.com
Content-Length: 39

Request Body
{"name": "Hello.docx", "file": {} }

Response:
HTTP/1.1 401 Unauthorized
Content-Type: application/json

{
  "error": 
  {
    "code": "unauthenticated",
    "message": "The caller is not authenticated.",
    "innerError": 
      {
      "request-id": "xxxxx-b23d-482c-xxxx-xxxxxxxx",
      "date": "2016-03-11T12:49:06"
      }
  }
}

如果与权限有关,能否请您告诉我要设置哪个应用程序权限才能正常工作?它甚至可以在 App-Only 授权流程中使用吗?

如有任何帮助,我们将不胜感激。

遗憾的是,OneDrive 实体尚不支持使用仅限应用的令牌进行访问。这绝对是我们希望尽快添加的内容,敬请期待。