Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions src/Microsoft.Identity.Web.TokenAcquisition/TokenAcquisition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,18 @@ public Task<AuthenticationResult> GetAuthenticationResultForAppAsync(

var builder = application
.AcquireTokenForClient(new[] { scope }.Except(_scopesRequestedByMsal))
.WithSendX5C(mergedOptions.SendX5C)
.WithTenantId(tenant);
.WithSendX5C(mergedOptions.SendX5C);

// MSAL.net only allows .WithTenantId for AAD authorities. This makes sense as there should
// not be cross tenant operations with such an authority.
if (!mergedOptions.Instance.Contains(".ciamlogin.com"
#if NETCOREAPP3_1_OR_GREATER
, StringComparison.OrdinalIgnoreCase
#endif
))
{
builder.WithTenantId(tenant);
}

if (tokenAcquisitionOptions != null)
{
Expand Down