【发布时间】:2019-12-19 23:51:13
【问题描述】:
我正在编写一个窗口应用程序来从个人和工作 onedrive 帐户下载文件。
同样的请求适用于工作帐户,但不适用于个人帐户。
不确定这是否与设置有关。
个人账户的重定向网址是 login.live.com/oauth20_desktop.srf。
身份验证通过以下方式完成:login.microsoftonline.com/common/oauth2/
个人和工作帐户的请求:
requestMessage = {Method: GET, RequestUri: 'https://graph.microsoft.com/v1.0/me/drive/root/children?pretty=false', Version: 1.1, Content: <null>, Headers:
{
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJub25jZSI6IkFRQUJBQUFBQUFEUk5ZUlEzZGhSU3JtLTRLLWFkcENKVm1pX2Fvb1NzcThPZ1g...
来自个人账号的回复:
httpResponse = {StatusCode: 400, ReasonPhrase: 'Bad Request', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
{
Transfer-Encoding: chunked
request-id: 843007b8-ebe4-4c9c-b260-d2a92512b672
client-request-id: 843007b8-ebe4-4c9c-b260-d2a92512b672
...
来自工作帐户的回复:
httpResponse = {StatusCode: 200, ReasonPhrase: 'OK', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
{
Transfer-Encoding: chunked
Vary: Accept-Encoding
request-id: a27688cb-fc5f-4e8c-8a9b-7a3ce1e4c98c
client-request-id: a27688cb-fc5f-4e8c-8a9b-...
【问题讨论】:
标签: office365 microsoft-graph-api onedrive