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

SkillDialog.InterceptOAuthCardsAsync doesn't support CloudAdapter #6841

Closed tracyboehrer closed 2 months ago

tracyboehrer commented 3 months ago
if (string.IsNullOrWhiteSpace(connectionName) || !(turnContext.Adapter is IExtendedUserTokenProvider tokenExchangeProvider))
{
    // The adapter may choose not to support token exchange, in which case we fallback to showing an oauth card to the user.
    return false;
}

CloudAdapter doesn't support IExtendedUserTokenProvider. It uses UserTokenClient from TurnContext.TurnState. See UserTokenAccess for an example on how to support both.