Skip to content

Commit

Permalink
use valid token issuer Url template
Browse files Browse the repository at this point in the history
  • Loading branch information
JhontSouth committed Apr 3, 2024
1 parent 0108ac2 commit 982564e
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 982564e

Please sign in to comment.