We have an on-premise installation of sharepoint 2013 with an app domain configured.

So far so good, I can create a Sharepoint Provider hosted app, where the Web-project runs on a local IIS. The sharepoint app part contains a list definition with a remote evenet reciever that is contained inside the web-project.

I did register the app using appregnew.aspx page.

Now everytime I add an item to the list, the webservices gets called correctly. However I can't load the clientContext using

using (ClientContext clientContext = TokenHelper.CreateRemoteEventReceiverClientContext(properties))
    if (clientContext != null)

        if (properties.EventType == SPRemoteEventType.ItemAdded)


When I check the Error-Properties of the variable "properties", I get following message: enter image description here

I tried all different kinds of app registrations on the page appregnew.aspx. Also I added the endpoint adress to <RemoteEndpoints> tag inside the AppManifest.xml

Can anybody help me out here? This error starts to drive me crazy after hours of debugging...

  • How are you authenticating the app? Have you created the certificates? Commented Mar 28, 2014 at 8:32
  • I thought it does not need any certicicates when developing... What certificates would I need then? Also this is an company intern app, which means it will never be publsihed to the app store
    – RononDex
    Commented Mar 28, 2014 at 8:33
  • I agree with your answer below @NadeemYousuf (+1), although isn't the error message a bit strange? It looks like some property on the web (of the app) should have the same address as itself? (I have worked it provider-hosted, but not provider-hosted remote event receivers).
    – eirikb
    Commented Mar 28, 2014 at 8:44
  • Frankly I am yet to understand several environment specific details of the apps. I have seen several kind of errors coming up when remote events or app events are added to apps compared to when you create an app without events. Commented Mar 28, 2014 at 8:54

1 Answer 1


When developing a high trust provider hosted app in VS, you are asked "How do you want you app to authenticate". Here you have got two options. If you are developing for on premise you can select "Use a certificate". The certificates are created in IIS. See this for more information on setting up dev environment for provider hosted apps. http://sharepointnadeem.blogspot.com/2014/02/sharepoint-2013-provider-hosted-app.html

  • Now I am getting Error 401 Authentication failure
    – RononDex
    Commented Mar 28, 2014 at 9:14
  • 1
    I managed to get it working in the end, turned out that sharepoint had some issues registering my certificate. After creating a new certificate it worked :)
    – RononDex
    Commented Mar 28, 2014 at 14:57
  • Good to hear that Commented Mar 28, 2014 at 15:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.