{"id":7917,"date":"2015-04-22T13:33:00","date_gmt":"2015-04-22T13:33:00","guid":{"rendered":"https:\/\/test.simple-talk.com\/uncategorized\/high-trust-certificate-error-adding-app-to-site-in-sharepoint\/"},"modified":"2016-07-28T10:56:30","modified_gmt":"2016-07-28T10:56:30","slug":"high-trust-certificate-error-adding-app-to-site-in-sharepoint","status":"publish","type":"post","link":"https:\/\/www.red-gate.com\/simple-talk\/blogs\/high-trust-certificate-error-adding-app-to-site-in-sharepoint\/","title":{"rendered":"High Trust Certificate Error Adding App to Site in SharePoint"},"content":{"rendered":"<p>I was deploying a SharePoint App-Model app in my development environment.&#160; It went into the catalog just fine, but it failed when trying to add it to a SharePoint site.&#160; It uses a remote web and has application install event receivers.&#160; The helpful error message that came back just said that the event receivers failed to return a successful response.&#160; There was also a correlation ID that I used to track down the following exception in the ULS:<\/p>\n<p>e6059cf2-70ba-4799-a656-4eb6ec3fbc5c Stack trace:&#160;&#160; <br \/> at Microsoft.SharePoint.SPUser.get_UserToken()&#160;&#160;&#160; <br \/> at Microsoft.SharePoint.Lifecycle.SPAppPrincipalAccessTokenTask.Deploy()&#160;&#160;&#160; <br \/> at Microsoft.SharePoint.Administration.SPAppTask.DeployOperation()&#160;&#160;&#160; <br \/> at Microsoft.SharePoint.Lifecycle.MonitoredTaskExecution.DoTask()&#160;&#160;&#160; <br \/> at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)&#160;&#160;&#160; <br \/> at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)&#160;&#160;&#160; <br \/> at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)&#160;&#160;&#160; <br \/> at System.Threading.ThreadHelper.ThreadStart()<\/p>\n<p>Super helpful.&#160; Since this is a development environment I&#8217;m running in high-trust mode, which means that we have a certificate that drives the authentication mechanism apps use to talk to SharePoint.&#160; When I reviewed the remote web&#8217;s web.config, it turns out that that it was configured to use the wrong certificate.&#160; After changing to the correct one, the error went away.&#160; Unfortunately, the error message does absolutely nothing to point you in the right direction. I presume that the same error will occur if your certificate password or issuer ID are invalid too, so you may have a couple of configuration settings to look at if you run into this error message.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was deploying a SharePoint App-Model app in my development environment.&#160; It went into the catalog just fine, but it failed when trying to add it to a SharePoint site.&#160; It uses a remote web and has application install event receivers.&#160; The helpful error message that came back just said that the event receivers failed&#8230;&hellip;<\/p>\n","protected":false},"author":46738,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[2],"tags":[],"coauthors":[],"class_list":["post-7917","post","type-post","status-publish","format-standard","hentry","category-blogs"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/7917","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/users\/46738"}],"replies":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/comments?post=7917"}],"version-history":[{"count":3,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/7917\/revisions"}],"predecessor-version":[{"id":42480,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/7917\/revisions\/42480"}],"wp:attachment":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/media?parent=7917"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/categories?post=7917"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/tags?post=7917"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/coauthors?post=7917"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}