From 982564e64d83465d0b45710c0898e815cc26c0fa Mon Sep 17 00:00:00 2001 From: JhontSouth Date: Wed, 3 Apr 2024 07:18:57 -0500 Subject: [PATCH] use valid token issuer Url template --- .../botframework-connector/src/auth/emulatorValidation.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libraries/botframework-connector/src/auth/emulatorValidation.ts b/libraries/botframework-connector/src/auth/emulatorValidation.ts index b40070fee2..c9d2b8344a 100644 --- a/libraries/botframework-connector/src/auth/emulatorValidation.ts +++ b/libraries/botframework-connector/src/auth/emulatorValidation.ts @@ -77,16 +77,16 @@ export namespace EmulatorValidation { //Validation to manage the issuer object as a string[]. if (Array.isArray(ToBotFromBotOrEmulatorTokenValidationParameters.issuer)) { - const tid = token?.payload?.tid ? '/' + token.payload.tid + '/' : ''; + const tenantId = token?.payload?.tid ?? ''; //Validate if there is an existing issuer with the same tid value. if ( - tid != '' && - ToBotFromBotOrEmulatorTokenValidationParameters.issuer.find((issuer) => issuer.includes(tid)) == null + tenantId != '' && + ToBotFromBotOrEmulatorTokenValidationParameters.issuer.find((issuer) => issuer.includes(tenantId)) == null ) { //If the issuer doesn't exist, this is added using the Emulator token issuer structure. //This allows use of the SingleTenant authentication through Emulator. - const newIssuer = 'https://sts.windows.net' + tid; + const newIssuer = AuthenticationConstants.ValidTokenIssuerUrlTemplateV1 + `${tenantId}/`; ToBotFromBotOrEmulatorTokenValidationParameters.issuer.push(newIssuer); } }