I'm running a provider-hosted Add-In in SharePoint Online. I want to do some stuff in Remote Event Receivers that change list items that connected users cannot do.
The problem I'm facing is the user that appears when made the changes to the list item is the add-In itself or a user with full permission (if I use a brand new forced clientContext to make changes). But I need the connected user to appear in the last modification.
In custom actions or Requests, it is possible to manage. Because I have access to the clientContext of the connected user. But not in RER.
Reading the following article seems using low trust authorization should work, but I get Acces denied permissions message. And I've set web and site collection permissions to full control. https://docs.microsoft.com/en-us/sharepoint/dev/solution-guidance/elevated-privileges-in-sharepoint-add-ins
<AppPermissionRequests AllowAppOnlyPolicy="false">
<AppPermissionRequest Scope="http://sharepoint/content/sitecollection/web" Right="FullControl" />
<AppPermissionRequest Scope="http://sharepoint/content/sitecollection" Right="FullControl" />
</AppPermissionRequests>
I read a lot about it and I figure out in RER, the only way to operate in "elevated permissions" is to set AllowAppOnlyPolicy="true" But this eliminates the possibility to view the connected user as the user who made modifications, as explained here.
https://www.sharepointnutsandbolts.com/2014/07/remote-event-receivers-on-host-web-ClientContext.html
I also tried to claim for TENANT permissions, but when start debugging, confirm button is disabled. My user is tenant admin, so I don't know how to pass this step.
I spent a lot of time on it and run out of ideas. Any ideas about how to do it?