Skip to content

Commit

Permalink
Merge pull request #3564 from microsoft/tedlee/fix-oauth-credentials (#…
Browse files Browse the repository at this point in the history
…3571)

[OAuth]do not set signInLink to empty when OAuthAppCredentials is set
  • Loading branch information
carlosscastro authored Mar 16, 2020
1 parent 2acec1c commit d14795f
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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<ClaimsIdentity>(BotAdapter.BotIdentityKey) is ClaimsIdentity botIdentity && SkillValidation.IsSkillClaim(botIdentity.Claims)))
(turnContext.TurnState.Get<ClaimsIdentity>(BotAdapter.BotIdentityKey) is ClaimsIdentity botIdentity && SkillValidation.IsSkillClaim(botIdentity.Claims)) ||
_settings.OAuthAppCredentials != null)
{
if (turnContext.Activity.ChannelId == Channels.Emulator)
{
Expand Down

0 comments on commit d14795f

Please sign in to comment.