-
Notifications
You must be signed in to change notification settings - Fork 492
Closed
Labels
Area: AuthenticationThe issue is related to authenticating users (SSO, OAuth, etc.)The issue is related to authenticating users (SSO, OAuth, etc.)Area: StreamingIssues related to streaming supportIssues related to streaming supportP1Painful if we don't fix, won't block releasingPainful if we don't fix, won't block releasingSize: SThe issue is simple and well understood, it will take a day or less to completeThe issue is simple and well understood, it will take a day or less to completebugIndicates an unexpected problem or an unintended behavior.Indicates an unexpected problem or an unintended behavior.
Milestone
Description
Version
4.10.3
Describe the bug
The ClaimsIdentity is not populated in the TurnState for streaming scenarios.
To Reproduce
- Setup the 24.bot-authentication-msgraph sample
- Configure Direct Line ASE or Direct Line Speech for the bot
- Ping the bot via Web Chat
- Check bot's logs for error,
Unable to get the bot AppId from the audience claim.
Expected behavior
The bot should have the ClaimsIdentity available for normal streaming scenarios.
Additional context
There exists a workaround for populating the ClaimsIdentity in a BotFrameworkHttpAdapterBase subclass, which adequately works for Direct Line ASE. However, this route does not support dynamic setting which means it will not work on a bot using multiple Bot Channels Registrations with Direct Line Speech. (e.g. multiple AAD AppIds)
The BotframeworkHttpAdapter should populate the ClaimsIdentity during a successful upgrade for Direct Line Speech.
Direct Line ASE/Single AAD AppId workaround:
public class AdapterWithErrorHandler : BotFrameworkHttpAdapter
{
public AdapterWithErrorHandler(IConfiguration configuration, ILogger<BotFrameworkHttpAdapter> logger, ConversationState conversationState = null)
: base(configuration, logger)
{
// For OAuth + Direct Line ASE scenarios, create and store a ClaimsIdentity with the AppId of the bot.
var appId = configuration.GetSection(MicrosoftAppCredentials.MicrosoftAppIdKey)?.Value;
ClaimsIdentity = new ClaimsIdentity(new List<Claim>{
new Claim(AuthenticationConstants.AudienceClaim, appId)
});
Metadata
Metadata
Assignees
Labels
Area: AuthenticationThe issue is related to authenticating users (SSO, OAuth, etc.)The issue is related to authenticating users (SSO, OAuth, etc.)Area: StreamingIssues related to streaming supportIssues related to streaming supportP1Painful if we don't fix, won't block releasingPainful if we don't fix, won't block releasingSize: SThe issue is simple and well understood, it will take a day or less to completeThe issue is simple and well understood, it will take a day or less to completebugIndicates an unexpected problem or an unintended behavior.Indicates an unexpected problem or an unintended behavior.