diff --git a/src/Microsoft.Identity.Web/TokenAcquisition.cs b/src/Microsoft.Identity.Web/TokenAcquisition.cs index 4845e0cd9..973acc52d 100644 --- a/src/Microsoft.Identity.Web/TokenAcquisition.cs +++ b/src/Microsoft.Identity.Web/TokenAcquisition.cs @@ -86,8 +86,8 @@ public TokenAcquisition( private readonly ISet _metaTenantIdentifiers = new HashSet( new[] { + Constants.Common, Constants.Organizations, - Constants.Consumers, }, StringComparer.OrdinalIgnoreCase); @@ -271,6 +271,11 @@ public async Task GetAccessTokenForAppAsync( throw new ArgumentException(IDWebErrorMessage.ClientCredentialScopeParameterShouldEndInDotDefault, nameof(scope)); } + if (string.IsNullOrEmpty(tenant)) + { + tenant = _applicationOptions.TenantId ?? _microsoftIdentityOptions.TenantId; + } + if (!string.IsNullOrEmpty(tenant) && _metaTenantIdentifiers.Contains(tenant)) { throw new ArgumentException(IDWebErrorMessage.ClientCredentialTenantShouldBeTenanted, nameof(tenant));