Question

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)
    {
        clientContext.Load(clientContext.Web);
        clientContext.ExecuteQuery();

        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...

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top