Contents
What are remote event receivers on host web?
The issue is purely related to RERs on the host web. Remote Event Receivers are similar to traditional full-trust event receivers, in that both async and sync events can be used.
The event receiver uses CSOM code to talk to SharePoint (rather than just using NON-SharePoint code) When you’re trying to use RERs on the host web, what you might see is that whilst your event receiver always fires (and your remote code does execute), your code fails to authenticate back to SharePoint.
Why is my event receiver not receiving a context token?
If you do some debugging, you’ll find that the event receiver does NOT receive a valid context token from SharePoint/Office 365 – SPRemoteEventProperties.ContextToken is an empty string. This causes all the later code to fail.
Can a RER be registered with user authentication?
If the RER is registered using *user authentication*, e.g. with the SharePointOnlineCredentials class, then you WILL see the behavior detailed here – so your choices then are either to register the RER with app authentication, or use the app-only approach detailed below in your code.
Using the remote event receiver pattern with a change log pattern provides a more reliable architecture for handling all changes made to SharePoint content databases, site collections, sites, or lists. Remote event receivers run immediately, but because they run on a remote server, you might encounter a communication failure.
Do you need manage permission for a remote event receiver?
Attaching a remote event receiver to an object in the host web usually requires Manage permission for that object only. For example, when attaching an event receiver to an existing list, the add-in requires Manage permission on the List only.