Microsoft graph api 调用graph API通过另一个REST服务访问oneDrive(office365)

Microsoft graph api 调用graph API通过另一个REST服务访问oneDrive(office365),microsoft-graph-api,onedrive,office365api,Microsoft Graph Api,Onedrive,Office365api,我们希望通过REST服务将文件上载到oneDrive。在REST服务中,我们调用了Microsoft Graph API,但我得到了401错误,我想这是因为授权问题,我想知道这里的最佳方法是什么 如果在我们的web应用程序上,整个过程都可以很好地工作 我在Azure Active Directory门户中授予了应用程序权限,并在 https://login.microsoftonline.com/<tenant>/adminconsent?client_id=<client-

我们希望通过REST服务将文件上载到oneDrive。在REST服务中,我们调用了Microsoft Graph API,但我得到了401错误,我想这是因为授权问题,我想知道这里的最佳方法是什么

如果在我们的web应用程序上,整个过程都可以很好地工作

我在Azure Active Directory门户中授予了应用程序权限,并在

 https://login.microsoftonline.com/<tenant>/adminconsent?client_id=<client-id>
我使用以下API检查文件是否存在:

"https://graph.microsoft.com/v1.0/sites/<siteid>/drive/root:/<filePath>:/children"
”https://graph.microsoft.com/v1.0/sites//drive/root:/:/children"
我不确定需要设置哪些角色/权限

{
"statuscode": 403,
"body": "{\r\n  \"error\": {\r\n    \"code\": \"AccessDenied\",\r\n    \"message\": \"Either scp or roles claim need to be present in the token.\",\r\n    \"innerError\": {\r\n      \"date\": \"2020-08-13T10:12:33\",\r\n      \"request-id\": \"338a2758-m7e0-4289-bnna-45pb14c79efa\"\r\n    }\r\n  }\r\n}"
}
"https://graph.microsoft.com/v1.0/sites/<siteid>/drive/root:/<filePath>:/children"