From d14795f53fa9f2827f395cb5492aeabc470859bf Mon Sep 17 00:00:00 2001 From: Carlos Castro Date: Sun, 15 Mar 2020 17:06:51 -0700 Subject: [PATCH] Merge pull request #3564 from microsoft/tedlee/fix-oauth-credentials (#3571) [OAuth]do not set signInLink to empty when OAuthAppCredentials is set --- .../Microsoft.Bot.Builder.Dialogs/Prompts/OAuthPrompt.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libraries/Microsoft.Bot.Builder.Dialogs/Prompts/OAuthPrompt.cs b/libraries/Microsoft.Bot.Builder.Dialogs/Prompts/OAuthPrompt.cs index 0cfe692f1a..f575e9c5ff 100644 --- a/libraries/Microsoft.Bot.Builder.Dialogs/Prompts/OAuthPrompt.cs +++ b/libraries/Microsoft.Bot.Builder.Dialogs/Prompts/OAuthPrompt.cs @@ -347,8 +347,13 @@ private static bool ChannelSupportsOAuthCard(string channelId) var signInResource = await adapter.GetSignInResourceAsync(turnContext, _settings.OAuthAppCredentials, _settings.ConnectionName, turnContext.Activity.From.Id, null, cancellationToken).ConfigureAwait(false); var value = signInResource.SignInLink; + // use the SignInLink when + // in speech channel or + // bot is a skill or + // an extra OAuthAppCredentials is being passed in if (turnContext.Activity.IsFromStreamingConnection() || - (turnContext.TurnState.Get(BotAdapter.BotIdentityKey) is ClaimsIdentity botIdentity && SkillValidation.IsSkillClaim(botIdentity.Claims))) + (turnContext.TurnState.Get(BotAdapter.BotIdentityKey) is ClaimsIdentity botIdentity && SkillValidation.IsSkillClaim(botIdentity.Claims)) || + _settings.OAuthAppCredentials != null) { if (turnContext.Activity.ChannelId == Channels.Emulator) {