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

Commit 005d25d

Browse files
Apply fix of allowedCallersClaimsValidator for the generator template
1 parent f1061fa commit 005d25d

File tree

1 file changed

+9
-5
lines changed
  • templates/typescript/generator-bot-virtualassistant/generators/app/templates/sample-assistant/src

1 file changed

+9
-5
lines changed

templates/typescript/generator-bot-virtualassistant/generators/app/templates/sample-assistant/src/index.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,16 @@ const credentialProvider: SimpleCredentialProvider = new SimpleCredentialProvide
7777
// Register the skills configuration class.
7878
const skillsConfig: SkillsConfiguration = new SkillsConfiguration(appsettings.botFrameworkSkills as IEnhancedBotFrameworkSkill[], appsettings.skillHostEndpoint);
7979

80+
let authenticationConfiguration = new AuthenticationConfiguration();
81+
8082
// Register AuthConfiguration to enable custom claim validation.
81-
const allowedCallers: string[] = [...skillsConfig.skills.values()].map(skill => skill.appId);
82-
const authenticationConfiguration = new AuthenticationConfiguration(
83-
undefined,
84-
allowedCallersClaimsValidator(allowedCallers)
85-
);
83+
if (skillsConfig.skills.size > 0) {
84+
const allowedCallers: string[] = [...skillsConfig.skills.values()].map(skill => skill.appId);
85+
authenticationConfiguration = new AuthenticationConfiguration(
86+
undefined,
87+
allowedCallersClaimsValidator(allowedCallers)
88+
);
89+
}
8690

8791
// Configure telemetry
8892
const telemetryClient: BotTelemetryClient = getTelemetryClient(settings);

0 commit comments

Comments
 (0)