title: How to manage multiple Tenants, ClientIDs and Endpoints with ADAL js frontend?
body: <h3>Background:</h3>
  
  <ul>
  <li>We use a single-tenant-per-application model</li>
  <li>All tenants run the same frontend and backend code that is deployed and hosted separately under different subdomains for each tenant</li>
  <li>We provision separate AzureAD applications for each tenant, resulting in in a different ClientIDs for each</li>
  </ul>
  
  <h3>Problem:</h3>
  
  <p>As per the ADAL js wiki found here: <a href="https://github.com/AzureAD/azure-activedirectory-library-for-js/wiki/Config-authentication-context" rel="nofollow noreferrer">https://github.com/AzureAD/azure-activedirectory-library-for-js/wiki/Config-authentication-context</a>, our frontend application must specify the ClientID and backend API Endpoints when initializing ADAL. </p>
  
  <p>Since each of our tenants has their own ClientID, we ended up adding all the possible ClientIDs and Endpoints into our code, and figuring out the values at runtime based on the current URL. This obviously doesn't scale very well as it requires a code change for each new tenant. We are thinking moving this work to the the CI/CD process, but are trying to understand if there is a better solution.</p>
  
  <p><strong>Is there a better way to manage multiple, single-tenant apps with ADAL js?</strong> </p>