Sharepoint Rest API office365 库 - 403 客户端错误 - 权限 Sites.Selected

问题描述 投票:0回答:1

我是一名全球 o365 管理员,一位用户要求我通过 Pyhton 脚本访问 SharePoint,他向我分享了以下问题的代码:

我创建了一个Azure应用程序并将权限设置为“Sites.Selected”,并仅向所需的站点授予完全控制权。 (https://ashiqf.com/2021/03/15/how-to-use-microsoft-graph-sharepoint-sites-selected-application-permission-in-a-azure-ad-application-for-more-粒度控制/

但是用户仍然收到 403 错误,我想避免设置具有完全控制权的应用程序来完成 SharePoint 租户。

如果 REST API 无法使用“Sites.Selected”权限,我尝试寻找解决方案或答案

azure sharepoint-online sharepoint-rest-api
1个回答
0
投票

看来我找到了解决方案。

不使用此默认 XML 代码仅用于 SharePoint 应用程序

   <AppPermissionRequests AllowAppOnlyPolicy="true">
      <AppPermissionRequest Scope="http://sharepoint/content/tenant" Right="FullControl" />
    </AppPermissionRequests>

我将范围更改为 SharePoint 网站本身。

<AppPermissionRequest Scope="https://tenantname.sharepoint.com/sites/sitename"

信任警告也发生了变化,“让它完全控制所有网站集”。消失了

Screenshot from Example

Screenshot from my App

© www.soinside.com 2019 - 2024. All rights reserved.