From b9d9150cb9f93f485d3ceeeca616bbb1565b06f1 Mon Sep 17 00:00:00 2001 From: star <1598624985@qq.com> Date: Sat, 25 Jan 2025 10:44:35 +0800 Subject: [PATCH] fix(msal-node): change the condition of throwing missingTenantIdError --- lib/msal-node/src/client/ConfidentialClientApplication.ts | 2 +- lib/msal-node/test/client/ConfidentialClientApplication.spec.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/msal-node/src/client/ConfidentialClientApplication.ts b/lib/msal-node/src/client/ConfidentialClientApplication.ts index 8ea240a22e..78697d6304 100644 --- a/lib/msal-node/src/client/ConfidentialClientApplication.ts +++ b/lib/msal-node/src/client/ConfidentialClientApplication.ts @@ -185,7 +185,7 @@ export class ConfidentialClientApplication const authority = new UrlString(validRequest.authority); const tenantId = authority.getUrlComponents().PathSegments[0]; if ( - Object.values(AADAuthorityConstants).includes( + [AADAuthorityConstants.COMMON, AADAuthorityConstants.ORGANIZATIONS].includes( tenantId as AADAuthorityConstants ) ) { diff --git a/lib/msal-node/test/client/ConfidentialClientApplication.spec.ts b/lib/msal-node/test/client/ConfidentialClientApplication.spec.ts index fd93da9748..cd396124d4 100644 --- a/lib/msal-node/test/client/ConfidentialClientApplication.spec.ts +++ b/lib/msal-node/test/client/ConfidentialClientApplication.spec.ts @@ -483,7 +483,7 @@ describe("ConfidentialClientApplication", () => { await client.acquireTokenByClientCredential(request); }); - test('acquireTokenByClientCredential throws missingTenantIdError if "common", ""organization", or "consumers" was provided as the tenant id', async () => { + test('acquireTokenByClientCredential throws missingTenantIdError if "common", "organization" was provided as the tenant id', async () => { const request: ClientCredentialRequest = { scopes: TEST_CONSTANTS.DEFAULT_GRAPH_SCOPE, skipCache: false,