Skip to content

Commit 1e99d5e

Browse files
Merge pull request #3564 from microsoft/tedlee/fix-oauth-credentials (#3571)
[OAuth]do not set signInLink to empty when OAuthAppCredentials is set
1 parent 0591aec commit 1e99d5e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

libraries/Microsoft.Bot.Builder.Dialogs/Prompts/OAuthPrompt.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,8 +347,13 @@ private static bool ChannelSupportsOAuthCard(string channelId)
347347
var signInResource = await adapter.GetSignInResourceAsync(turnContext, _settings.OAuthAppCredentials, _settings.ConnectionName, turnContext.Activity.From.Id, null, cancellationToken).ConfigureAwait(false);
348348
var value = signInResource.SignInLink;
349349

350+
// use the SignInLink when
351+
// in speech channel or
352+
// bot is a skill or
353+
// an extra OAuthAppCredentials is being passed in
350354
if (turnContext.Activity.IsFromStreamingConnection() ||
351-
(turnContext.TurnState.Get<ClaimsIdentity>(BotAdapter.BotIdentityKey) is ClaimsIdentity botIdentity && SkillValidation.IsSkillClaim(botIdentity.Claims)))
355+
(turnContext.TurnState.Get<ClaimsIdentity>(BotAdapter.BotIdentityKey) is ClaimsIdentity botIdentity && SkillValidation.IsSkillClaim(botIdentity.Claims)) ||
356+
_settings.OAuthAppCredentials != null)
352357
{
353358
if (turnContext.Activity.ChannelId == Channels.Emulator)
354359
{

0 commit comments

Comments
 (0)