question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

OAuthInput does not work from within MS Teams chat context

See original GitHub issue

Version

4.10.0

Describe the bug

OauthInput for AdaptiveDialog is not working in MS Teams

To Reproduce

Steps to reproduce the behavior:

  1. Implement OAuthInput dialog to connect to a Generic Oauth provider using bot service
  2. Test locally, works
  3. Test remote using webchat, works
  4. Deploy in Teams using manifest
  5. Card shows to sign in, clicking the sign-in button doesn’t prompt any login / pop-up whatsoever, no message no nothing

Expected behavior

I’d expect the bot to behave the same as when using webchat, and thus display a prompt to login to the generic OAuth provider.

Additional context

Code snippet for the Oauth dialog creation, there’s not much more to it:

_oauthDialog = new OAuthInput()
{
    ConnectionName = configuration["ConnectionName"],
    Title = "Sign in",
    Text = "Please sign in using OAuth",
    Property = "user.authToken"
};

Maybe this bug belongs to MS Teams instead, I’m not sure and I have no way of telling it does I guess.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:17 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
EricDahlvangcommented, Aug 31, 2020

@jsiegmund

Unfortunately, we have duplicate code in OAuthInput and OAuthPrompt, and it has diverged.

Those same lines in OAuthPrompt have been updated as follows: https://github.com/microsoft/botbuilder-dotnet/blob/main/libraries/Microsoft.Bot.Builder.Dialogs/Prompts/OAuthPrompt.cs#L401

f (turnContext.Activity.IsFromStreamingConnection() ||
                    (turnContext.TurnState.Get<ClaimsIdentity>(BotAdapter.BotIdentityKey) is ClaimsIdentity botIdentity && SkillValidation.IsSkillClaim(botIdentity.Claims)) ||
                    _settings.OAuthAppCredentials != null)
                {
                    if (turnContext.Activity.ChannelId == Channels.Emulator)
                    {
                        cardActionType = ActionTypes.OpenUrl;
                    }
                }
                else if (!ChannelRequiresSignInLink(turnContext.Activity.ChannelId))
                {
                    value = null;
                }

This same code should be in OAuthInput. I’ve raised this issue: https://github.com/microsoft/botbuilder-dotnet/issues/4467 to track.

1reaction
jeissingcommented, Aug 27, 2020

We have the same Issue. When comparing the versions 4.9 and 4.10 of the OAuthInput.cs you will notice that in the method “ChannelSupportsOAuthCard” in version 4.10 the case statemant “case Channels.MSTeams” is no longer present. This leads to the fact that the Card is not generated as in 4.9, but is loaded from a resource. After we have reintroduced the mentioned case statemant, the MS-Teams login works again as expected. Probably something is wrong with the loaded card resource.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Teams App Message Extension not working in Chat Context
Hi, We are seeing "Something went wrong. Please try again." when opening message extension in the new chat window context by selecting the...
Read more >
Teams - Right Click Context Menu not coming up
Hello, I've got a strange issue in teams. Right clicking in the "Type a new message" field in teams isn't working, the context...
Read more >
Right-Clicking Chat Field & Spell Checking Not Working
When right-clicking a chat field to receive a spell-checking suggestion or right-clicking to paste, no right-click menu appears. If you close ...
Read more >
Show context around old Teams messages from search ...
Looking for help with a particular issue with searching for older messages inside of Teams. When I search for a certain keyword -...
Read more >
Teams messages search function does not show full ...
Teams messages search function does not show full conversation. When using the search function in Teams chat, is there a way to see...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found