Skip to content
This repository has been archived by the owner on Jun 30, 2022. It is now read-only.

Commit

Permalink
Apply fix of allowedCallersClaimsValidator for the generator template
Browse files Browse the repository at this point in the history
  • Loading branch information
FedericoBernal committed Jun 17, 2021
1 parent f1061fa commit 005d25d
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,16 @@ const credentialProvider: SimpleCredentialProvider = new SimpleCredentialProvide
// Register the skills configuration class.
const skillsConfig: SkillsConfiguration = new SkillsConfiguration(appsettings.botFrameworkSkills as IEnhancedBotFrameworkSkill[], appsettings.skillHostEndpoint);

let authenticationConfiguration = new AuthenticationConfiguration();

// Register AuthConfiguration to enable custom claim validation.
const allowedCallers: string[] = [...skillsConfig.skills.values()].map(skill => skill.appId);
const authenticationConfiguration = new AuthenticationConfiguration(
undefined,
allowedCallersClaimsValidator(allowedCallers)
);
if (skillsConfig.skills.size > 0) {
const allowedCallers: string[] = [...skillsConfig.skills.values()].map(skill => skill.appId);
authenticationConfiguration = new AuthenticationConfiguration(
undefined,
allowedCallersClaimsValidator(allowedCallers)
);
}

// Configure telemetry
const telemetryClient: BotTelemetryClient = getTelemetryClient(settings);
Expand Down

0 comments on commit 005d25d

Please sign in to comment.