Friday, September 9, 2016

"Your domain doesn't match the expected domain for this app deployment." issue in provider hosted add-in


One of my friend had an issue after deploying his provider hosted add-in in SharePoint on premise environment. He was not able to access list data from the add-in web of the Add-in. I looked at the code and the error was something as below.



Step 01

Get the add-in id by navigating to


App identifier was something like the below and the text which was bolded will be the add-in id.


Step 02

Get the App Domain by going to below url and giving the add-in id which we got from the above.


Step 03

My observation was that the App Domain which was given during registering the add-in was different from the url where the add-in has been hosted.

So, I registered the add-in again in the SharePoint site with the correct IIS host header and redeployed the add-in; which lead to work perfectly.