|
1 | 1 | - The SharePoint site URL. |
2 | 2 |
|
3 | | - - Site URLs typically have the format `https://<tenant>.sharepoint.com`. |
4 | | - - Relative site URLs typically have the format `https://<tenant>.sharepoint.com/sites/<site_name>`. |
5 | | - - To process all sites within a tenant, use a site URL of `https://<tenant>-admin.sharepoint.com`. This requires the app to be registered at a tenant level. |
| 3 | + - Site collection-level URLs typically have the format `https://<tenant>.sharepoint.com/sites/<site-collection-name>`. |
| 4 | + - Root site collection-level URLs typically have the format `https://<tenant>.sharepoint.com`. |
| 5 | + - To process all sites within a tenant, use a site URL of `https://<tenant>-admin.sharepoint.com`. |
6 | 6 |
|
7 | 7 | [Learn more](https://learn.microsoft.com/microsoft-365/community/query-string-url-tricks-sharepoint-m365). |
8 | 8 |
|
9 | 9 | - The path in the SharePoint site from which to start parsing files, for example `"Shared Documents"`. If the connector is to process all sites within the tenant, this filter will be applied to all site document libraries. |
10 | | -- A SharePoint app principal with its application (client) ID, client secret, and access permissions to the SharePoint instance. [Get a client ID and client secret, and set access permissions](https://github.com/vgrem/Office365-REST-Python-Client/wiki/How-to-connect-to-SharePoint-Online-and-and-SharePoint-2013-2016-2019-on-premises--with-app-principal). |
| 10 | +- A SharePoint app principal with its application (client) ID, client secret, and the appropriate access permissions. |
11 | 11 |
|
12 | | - You can create SharePoint app principals through `https://<tenant>.sharepoint.com/_layouts/15/appregnew.aspx`. |
| 12 | + Complete the steps in the following sections, depending on whether you want to access sites at the site collection level, the |
| 13 | + root site collection level, or all sites within a tenant. |
| 14 | + |
| 15 | + <Note> |
| 16 | + Two of the main factors in the following sections are the scope of access |
| 17 | + and the level of administrative permissions required to create the app principal. Tenant-wide app principals offer the broadest access |
| 18 | + but require the highest level of administrative rights, while site collection app principals are more restricted but can be created by users |
| 19 | + with lower-level permissions. |
| 20 | + </Note> |
13 | 21 |
|
14 | | - For a SharePoint app principal with site-scoped permissions, use app permission request XML such as the following to grant |
15 | | - permissions through `https://<tenant>.sharepoint.com/_layouts/15/appinv.aspx`: |
| 22 | +## Tenant-wide SharePoint app principals |
16 | 23 |
|
17 | | - ```xml |
18 | | - <AppPermissionRequests AllowAppOnlyPolicy="true"> |
19 | | - <AppPermissionRequest Scope="http://sharepoint/content/sitecollection" Right="FullControl" /> |
20 | | - </AppPermissionRequests> |
21 | | - ``` |
| 24 | +Create a tenant-wide SharePoint app principal when you want the power and flexibility of a principal that can process all sites within a tenant. |
22 | 25 |
|
23 | | - For a SharePoint app principal with tenant-scoped permissions, use app permission request XML such as the following to grant |
24 | | - permissions through `https://<tenant>-admin.sharepoint.com/_layouts/15/appinv.aspx` instead: |
| 26 | +SharePoint app principals that are created in the SharePoint admin center have tenant-wide scope and can potentially access all sites within the tenant. |
| 27 | +Only global or SharePoint administrators typically have access to the following URLs. |
25 | 28 |
|
26 | | - ```xml |
27 | | - <AppPermissionRequests AllowAppOnlyPolicy="true"> |
28 | | - <AppPermissionRequest Scope="http://sharepoint/content/tenant" Right="FullControl" /> |
29 | | - </AppPermissionRequests> |
30 | | - ``` |
| 29 | +1. To create a tenant-wide SharePoint app principal and then get its client ID and client secret, go to the following URL: |
31 | 30 |
|
32 | | - Available `Right` settings include `Read`, `Write`, `Manage`, and `FullControl`. To learn more, see |
33 | | - [Add-in permissions in SharePoint](https://learn.microsoft.com/sharepoint/dev/sp-add-ins/add-in-permissions-in-sharepoint). |
| 31 | + `https://<tenant>-admin.sharepoint.com/_layouts/15/appregnew.aspx` |
34 | 32 |
|
| 33 | +2. To add access permissions to a tenant-wide SharePoint app principal and then get its client ID and client secret, go to the following URL: |
| 34 | + |
| 35 | + `https://<tenant>.sharepoint.com/_layouts/15/appinv.aspx` |
| 36 | + |
| 37 | +3. Apply the following permissions XML to the tenant-wide SharePoint app principal: |
| 38 | + |
| 39 | + ```xml |
| 40 | + <AppPermissionRequests AllowAppOnlyPolicy="true"> |
| 41 | + <AppPermissionRequest Scope="http://sharepoint/content/tenant" Right="FullControl" /> |
| 42 | + </AppPermissionRequests> |
| 43 | + ``` |
| 44 | + Available `Right` settings include `Read`, `Write`, `Manage`, and `FullControl`. To learn more, see |
| 45 | + [Add-in permissions in SharePoint](https://learn.microsoft.com/sharepoint/dev/sp-add-ins/add-in-permissions-in-sharepoint). |
| 46 | + |
| 47 | +[Learn how to complete these preceding steps](https://github.com/vgrem/Office365-REST-Python-Client/wiki/How-to-connect-to-SharePoint-Online-and-and-SharePoint-2013-2016-2019-on-premises--with-app-principal). |
| 48 | +Be sure to substitute the URLs and XML in the linked article with the ones in these preceding steps accordingly. |
| 49 | + |
| 50 | +## Root site collection-level SharePoint app principals |
| 51 | + |
| 52 | +Create a root site collection-level SharePoint app principal when you want a principal that can only access a root site collection, for example with a URL |
| 53 | +that has the format `https://<tenant>.sharepoint.com`. |
| 54 | + |
| 55 | +SharePoint app principals that are created at the root site collection level have a scope limited to the root site collection. Site collection administrators can usually access the following URLs. |
| 56 | + |
| 57 | +1. To create a root site collection-level SharePoint app principal and then get its client ID and client secret, go to the following URL: |
| 58 | + |
| 59 | + `https://<tenant>.sharepoint.com/_layouts/15/appregnew.aspx` |
| 60 | + |
| 61 | +2. To add access permissions to a root site collection-level SharePoint app principal, go to the following URL: |
| 62 | + |
| 63 | + `https://<tenant>.sharepoint.com/_layouts/15/appinv.aspx` |
| 64 | + |
| 65 | +3. Apply the following permissions XML to the root site collection-level SharePoint app principal: |
| 66 | + |
| 67 | + ```xml |
| 68 | + <AppPermissionRequests AllowAppOnlyPolicy="true"> |
| 69 | + <AppPermissionRequest Scope="http://sharepoint/content/sitecollection" Right="FullControl" /> |
| 70 | + </AppPermissionRequests> |
| 71 | + ``` |
| 72 | + |
| 73 | + Available `Right` settings include `Read`, `Write`, `Manage`, and `FullControl`. To learn more, see |
| 74 | + [Add-in permissions in SharePoint](https://learn.microsoft.com/sharepoint/dev/sp-add-ins/add-in-permissions-in-sharepoint). |
| 75 | + |
| 76 | +[Learn how to complete these preceding steps](https://github.com/vgrem/Office365-REST-Python-Client/wiki/How-to-connect-to-SharePoint-Online-and-and-SharePoint-2013-2016-2019-on-premises--with-app-principal). |
| 77 | +Be sure to substitute the URLs and XML in the linked article with the ones in these preceding steps accordingly. |
| 78 | + |
| 79 | +## Site collection-level SharePoint app principals |
| 80 | + |
| 81 | +Create a site collection-level SharePoint app principal when you want a principal that can only access a specific site collection, for example with a URL |
| 82 | +that has or starts with the format `https://<tenant>.sharepoint.com/sites/<site-collection-name>`. |
| 83 | + |
| 84 | +SharePoint app principals that are created at the site collection level have the most limited scope, restricted to the specific subsite and its subsites. |
| 85 | +Site owners or those with appropriate permissions on the subsite can access the following URLs. |
| 86 | + |
| 87 | +1. To create a site collection-level SharePoint app principal, go to the following URL: |
| 88 | + |
| 89 | + `https://<tenant>.sharepoint.com/sites/<site-collection-name>/_layouts/15/appregnew.aspx` |
| 90 | + |
| 91 | +2. To add access permissions to a site collection-level SharePoint app principal, go to the following URL: |
| 92 | + |
| 93 | + `https://<tenant>.sharepoint.com/sites/<site-collection-name>/_layouts/15/appinv.aspx` |
| 94 | + |
| 95 | +3. Apply the following permissions XML to the site collection-level SharePoint app principal: |
| 96 | + |
| 97 | + ```xml |
| 98 | + <AppPermissionRequests AllowAppOnlyPolicy="true"> |
| 99 | + <AppPermissionRequest Scope="http://sharepoint/content/sitecollection" Right="FullControl" /> |
| 100 | + </AppPermissionRequests> |
| 101 | + ``` |
| 102 | + |
| 103 | + Available `Right` settings include `Read`, `Write`, `Manage`, and `FullControl`. To learn more, see |
| 104 | + [Add-in permissions in SharePoint](https://learn.microsoft.com/sharepoint/dev/sp-add-ins/add-in-permissions-in-sharepoint). |
| 105 | + |
| 106 | +[Learn how to complete these preceding steps](https://github.com/vgrem/Office365-REST-Python-Client/wiki/How-to-connect-to-SharePoint-Online-and-and-SharePoint-2013-2016-2019-on-premises--with-app-principal). |
| 107 | +Be sure to substitute the URLs and XML in the linked article with the ones in these preceding steps accordingly. |
0 commit comments