我正在尝试使用“仅限应用” token 从 SharePoint Online 下载文件。我可以使用这个 url 获取文件信息
https://graph.microsoft.com:443/v1.0/sites/{siteId}/drives/{driveId}/list/items/{itemId}/driveItem
但是当我尝试使用此网址下载文件时
https://graph.microsoft.com:443/v1.0/sites/{siteId}/drives/{driveId}/list/items/{itemId}/driveItem/content
我收到以下错误
403 FORBIDDEN
Content-Length →13
Content-Type →text/plain; charset=utf-8
Date →Fri, 13 Apr 2018 08:47:12 GMT
MicrosoftSharePointTeamServices →16.0.0.7604
P3P →CP="ALL IND DSP COR ADM CONo CUR CUSo IVAo IVDo PSA PSD TAI TELo OUR SAMo CNT COM INT NAV ONL PHY PRE PUR UNI"
SPIisLatency →2
SPRequestDuration →53
X-Content-Type-Options →nosniff
X-MS-InvokeApp →1; RequireReadOnly
X-MSDAVEXT_Error →917656; Access+denied.+Before+opening+files+in+this+location%2c+you+must+first+browse+to+the+web+site+and+select+the+option+to+login+automatically.
X-MSEdge-Ref →Ref A: B9E0C567B0CC4E60AEE93EEB8DC06AF1 Ref B: VIEEDGE0813 Ref C: 2018-04-13T08:47:12Z
X-Powered-By →ASP.NET
X-SharePointHealthScore →0
怎么了?
似乎在内部它生成了一个下载链接(.../_layouts/15/download.aspx?UniqueId=...),它适用于用户名/密码 token ,但不适用于“仅应用程序” token
我有另一个 Office 365 订阅,它适用于“仅应用” token 。另一个订阅有一个自定义域,但我看不到其他配置差异(两者都将 LegacyAuthProtocolsEnabled 属性设置为 true,相同的共享选项...)
编辑:看来我周五测试的例子现在有效了!!
最佳答案
这个错误在上周星期三出现,并且正在蔓延到我们越来越多的租户。 Graph API/Sharepoint API 生成的临时 token 似乎无效。这会影响:
请尽快修复此问题,因为我的应用程序已瘫痪且客户很生气
我也在这里创建了一个帖子,但没有回复:Temporary tokens issued by graph api is invalid since wednesday
这个错误也在周三出现:Unable to set fileSystemInfo.lastModifiedDateTime on files on Sharepoint Online for some users since wednesday
你在这个 Mark LeFleur 上找到什么了吗? ?
关于microsoft-graph-api - Microsoft Graph API 下载文件内容返回未授权 401,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49813381/