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
873 stars 483 forks source link

OAuthCard for slack still does not work #1040

Closed stevekay72 closed 5 years ago

stevekay72 commented 6 years ago

Github issues should be used for bugs and feature requests. Use Stack Overflow for general "how-to" questions.

Version

GA version of the bot framework V4 4.0.8

Describe the bug

Trying to authenticate a user inside the bot using the OAuthCard flow does not work for Slack. As per the example for AADv2 I implemented the 'dialog' way of authenticating the user and included the OAuth prompt. On web this works fine but in Slack it opens the browser to get the magic code and the code returned is not valid.

To Reproduce

Steps to reproduce the behavior:

  1. Use the AADv2 sample and register your bot with Slack
  2. Attempt to login
  3. Click the Sign In button and the login browser appears, log in and copy the magic code
  4. Paste and process the magic code and it is returned invalid

Expected behavior

The magic code returned should work and the user be logged in

Possible fix until remedied

in Microsoft.Bot.Builder.Dialogs/Prompts/OAuthPrompt.cs include "slack" in the method ChannelSupportsOAuthCard as an exception

[bug]

stevekay72 commented 6 years ago

I have cloned the OAuthPrompt class and created my own including "slack" to stop it using the OAuthCard and it now works

Jeffders commented 5 years ago

@stevekay72 Thanks for reporting this. It turns out this is a service side issue that has been fixed and will be deployed the second week of December. In the time being, using the GetSignInLink or creating your own OAuthPrompt that adds 'slack' to the list of channels that use SignIn Cards with GetSignInLink (like Cortana and Teams) is the best work-around.