SharePoint Provider Hosted Application for US Government Cloud

We have an application hosted by a standard provider that works in normal SharePoint online rentals. We have to use the same thing for a US government client and their lease agreement with SPOnline is in the government cloud. Currently, we get (401) an unauthorized error when we try to create a context in the event installed in the application in the Azure component.

According to this article, we must change tokenhelper.cs. However, the "Azure ACS Endpoints" described in this article are the same for Production and the US Government. Although the "Azure AD endpoints" are different, we do not understand where this needs to be changed in the code. Although the article mentions PnP but I would really like to understand what changes are needed in the standard code for this to work.

Specific questions that I have:

  1. Can the same hosted application instance provider run in Production / US Gov / German clouds, etc.? or we need separate instances
  2. Can the hosted component of the deployed provider in a normal Azure instance work with a US Gov lease or must it be hosted in Azure Gov US only?
  3. According to the article, AcsHostUrl must be changed. How can tokenhelper.cs recognize which AcsHostUrl to use based on the request received? This is the case when the same web application instance will handle requests from different clouds.
  4. Any example project working with both environments or only with the US Gov cloud

Thank you