microsoft / botbuilder-dotnet

Welcome to the Bot Framework SDK for .NET repository, which is the home for the libraries and packages that enable developers to build sophisticated bot applications using .NET.
https://github.com/Microsoft/botframework
MIT License
878 stars 484 forks source link

Add SingleTenant/MSI Issuer to ValidTokenIssuers for Skill samples #6785

Closed tracyboehrer closed 2 months ago

tracyboehrer commented 6 months ago

See: libraries/Microsoft.Bot.Builder.Dialogs.Adaptive.Runtime/Extensions/ServiceCollectionExtensions.AddBotRuntimeSkills

// For SingleTenant/MSI auth, the JWT tokens will be issued from the bot's home tenant.
// So, these issuers need to be added to the list of valid token issuers for authenticating activity requests.
validTokenIssuers.Add(string.Format(CultureInfo.InvariantCulture, AuthenticationConstants.ValidTokenIssuerUrlTemplateV1, tenantId));
validTokenIssuers.Add(string.Format(CultureInfo.InvariantCulture, AuthenticationConstants.ValidTokenIssuerUrlTemplateV2, tenantId));
validTokenIssuers.Add(string.Format(CultureInfo.InvariantCulture, AuthenticationConstants.ValidGovernmentTokenIssuerUrlTemplateV1, tenantId));
validTokenIssuers.Add(string.Format(CultureInfo.InvariantCulture, AuthenticationConstants.ValidGovernmentTokenIssuerUrlTemplateV2, tenantId));

This is obscure. Research whether this could be added to ConfigurationBotFrameworkAuthentication or ConfigurationServiceClientCredentialFactory. Such that this would be automatic. This would impact the Adaptive Runtime, which would need to change too.

Would need to happen in JS too.