We have a standard provider hosted app that works in normal SharePoint online tenancies. We need to use the same for a US Gov customer and their SPOnline tenancy is in gov cloud. Currently we get (401) Unauthorized error when we try to create context in app installed event in the Azure component.
As per this article, we need to change tokenhelper.cs. However, 'Azure ACS endpoints' as given in this article is same for Production and US Government. Though 'Azure AD endpoints' is different, we don't understand where this needs to be changed in the code. Though article mentions PnP but I would really like to understand what changes are required in standard code to make it work.
Specific questions that I have:
- Can the same provider hosted app instance work in Production / US Gov / German etc. clouds or we need separate instances
- Can the provider hosted component deployed in normal Azure instance, work with US Gov tenancy or it has to be hosted in US Gov Azure only
- As per the article, AcsHostUrl has to be changed. How can tokenhelper.cs recognize which AcsHostUrl to use depending on the request received. This is for case where same instance of web app will handle requests from different clouds
- Any sample project that works with both environments or just the US Gov cloud