Forum Discussion

Productos's avatar
Productos
Copper Contributor
Mar 16, 2023

Error access denied with app-principals in Sharepoint Online

To activate an integration between a SAP system and Sharepoint Online, a security entity called SPFacturasSAP has been created, this entity has been created at the client's site and has been given full control permissions at the tenant level:

 

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

 

however when they try to upload files using this entity the following error is generated:

 

<?xml version="1.0" encoding="utf-8"?>
<m:error xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<m:code>-2147024891, System.UnauthorizedAccessException</m:code>
<m:message xml:lang="es-ES">Access denied.</m:message>
</m:error>

 

the apis that are being used to upload the files are: /_api/Web/GetFolderByServerRelativeUrl('{{file_rel_path}}')/Files/add(url='filename.png',overwrite=true) /_api/web/GetFolderByServerRelativePath (DecodedUrl='{{file_rel_path}}')/Files/AddUsingPath(DecodedUrl='DEMO.pdf',AutoCheckoutOnInvalidData=true)

 

Is there any additional configuration required?

3 Replies

Resources