Closed
Description
Is your feature request related to a problem? Please describe.
When a multi-tenant application (TenantId: "common" or "organizations") wants to acquire a token on behalf of itself, Microsoft.Identity.Web can't use the "TenantId" as this is not accepted by ESTS.
Today we require all developers to specify the tenant ID to use by code, or by configuration in the case of IDownstreamApi:
Describe the solution you'd like
- Add in the MicrosoftIdentityApplicationOptions (in Microsoft.Identity.Abstractions), a new string property
AppHomeTenantId
, which developers of multi-tenant apps could set in order to define the home tenant of the app (the tenant for which the app can get a token to call a downstream API on behalf of itself). This will usually be the app registration tenant. For instance, add it here - In Microsoft.Identity.Web,
- Add the same property to MergeOptions, and update the method that populates MergedOptions from MicrosoftIdentityApplicationOptions.
- when the token acquisition happens "for App", and if the TenantId is "common" or "organization" and the developer has not overriden the "TenantId" in the AcquireTokenOptions, use the
AppHomeTenantId
value. For this we would need to change this expression here to usemergedOptions.AppHomeTenantId
if it's not null, and throw otherwise, like today
- For Auto-decrypt (SAL) use the
AppHomeTenantId
if the CredentialDescription.DownstreamApi.AcquireTokenOptions.Tenant is not specified. Might not be necessary as IdWeb does the token acquisition, but needs to be verified - For MISE modules data providers, remove the configuration property that was using this tenant and let IdWeb do (or use the new property, instead of exposing it in each module configuration).
Describe alternatives you've considered
Multiply the same tenant value in all cases of auto-decrypt and MISE modules like today