From f85b567557737e965f30a5a961bafdb177b0dfa2 Mon Sep 17 00:00:00 2001 From: Robbie-Microsoft <87724641+Robbie-Microsoft@users.noreply.github.com> Date: Fri, 4 Oct 2024 16:45:54 -0400 Subject: [PATCH] msal-node e2e tests: cert_path -> certificate_path (#7357) @azure/identity's `new DefaultAzureCredential()` expects `AZURE_CLIENT_CERTIFICATE_PATH` instead of `AZURE_CLIENT_CERT_PATH`. [Corresponding 1-P PR](https://identitydivision.visualstudio.com/IDDP/_git/msal-javascript-1p/pullrequest/14791) --- gen_env.ps1 | 4 +++- samples/e2eTestUtils/src/Constants.ts | 2 +- samples/e2eTestUtils/src/LabClient.ts | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/gen_env.ps1 b/gen_env.ps1 index 2deaa43bd1..e751d235d6 100644 --- a/gen_env.ps1 +++ b/gen_env.ps1 @@ -1,8 +1,10 @@ # Variables +# To be used with @azure/identity functionality, they must adhere to the same names as described in: +# https://learn.microsoft.com/en-us/dotnet/api/azure.identity.environmentcredential?view=azure-dotnet $dotEnvFileName = ".env" $tenantIdInfo = 'AZURE_TENANT_ID="72f988bf-86f1-41af-91ab-2d7cd011db47"' $clientIdName = "AZURE_CLIENT_ID=" -$clientCertPathName = "AZURE_CLIENT_CERT_PATH=" +$clientCertPathName = "AZURE_CLIENT_CERTIFICATE_PATH=" $sessionSecretName = "SESSION_SECRET=" # Create file if it doesn't exist diff --git a/samples/e2eTestUtils/src/Constants.ts b/samples/e2eTestUtils/src/Constants.ts index 5d4928bf38..82ec1ef545 100644 --- a/samples/e2eTestUtils/src/Constants.ts +++ b/samples/e2eTestUtils/src/Constants.ts @@ -1,7 +1,7 @@ export const ENV_VARIABLES = { TENANT: "AZURE_TENANT_ID", CLIENT_ID: "AZURE_CLIENT_ID", - CERT_PATH: "AZURE_CLIENT_CERT_PATH", + CERTIFICATE_PATH: "AZURE_CLIENT_CERTIFICATE_PATH", }; export const LAB_API_ENDPOINT = "https://msidlab.com/api"; diff --git a/samples/e2eTestUtils/src/LabClient.ts b/samples/e2eTestUtils/src/LabClient.ts index 3abaeb1c35..e44098b1db 100644 --- a/samples/e2eTestUtils/src/LabClient.ts +++ b/samples/e2eTestUtils/src/LabClient.ts @@ -22,7 +22,7 @@ export class LabClient { constructor() { const tenant = process.env[ENV_VARIABLES.TENANT]; const clientId = process.env[ENV_VARIABLES.CLIENT_ID]; - const client_cert_path = process.env[ENV_VARIABLES.CERT_PATH]; + const client_cert_path = process.env[ENV_VARIABLES.CERTIFICATE_PATH]; this.currentToken = null; if (!tenant || !clientId || !client_cert_path) { throw "Environment variables not set!";