microsoft / botframework-sdk

Bot Framework provides the most comprehensive experience for building conversation applications.
MIT License
7.49k stars 2.44k forks source link

AADv2 Sample not working with Slack #4914

Closed JasonSowers closed 5 years ago

JasonSowers commented 6 years ago

Bot Info

Issue Description

When using OAuth in Slack The bot fails to Authenticate after entering in the magic code. This may have something to do with the ':' in the slack userID.

Code Example

.Net - AAdv2Sample Node - basics-oauth

Reproduction Steps

  1. Follow this tutorial to get auth in your bot setup.
  2. Connect a bot to slack
  3. Complete the Auth flow

Expected Behavior

After entering the magic code the user is Authenticated

Actual Results

User is never signed in: In .Net no response if given to the user. In node the messages "Let's see if that code works..." then "Hmm, that code wasn't right" are displayed.

to this request:

{Method: GET, RequestUri: 'https://api.botframework.com/api/usertoken/GetToken?userId={USER_ID}&connectionName=AADv2Connection&code=832525', Version: 1.1, Content: <null>, Headers:
{
  Authorization: Bearer {TOKEN}
  User-Agent: Microsoft.Bot.Connector.OAuthClient/3.15.3.0
}}

reponse is a 404:

{StatusCode: 404, ReasonPhrase: 'Not Found', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
{
  Pragma: no-cache
  Request-Context: appId=cid-v1:234f01b1-3f0f-49c0-b49c-c528b5cef7a8
  Access-Control-Expose-Headers: Request-Context
  X-Content-Type-Options: nosniff
  Cache-Control: no-cache
  Date: Mon, 30 Jul 2018 22:17:52 GMT
  Server: Microsoft-IIS/10.0
  X-Powered-By: ASP.NET
  Content-Length: 0
  Expires: -1
}}
JasonSowers commented 6 years ago

I have posted a workaround in #4897 that can be used for a workaround for this issue as well. I added code in there to display a card rather than the link for channels other than Twilio.

mkonkolowicz commented 6 years ago

@JasonSowers the workaround def. worked. Thanks so much for your help! When can we expect this baked into the bot framework?

JasonSowers commented 6 years ago

@mkonkolowicz At this time we do not have a timeline to report. I will keep you updated as I have more information.

johnataylor commented 5 years ago

Thank you for opening an issue against the Bot Framework SDK v3. As part of the Bot Framework v4 release, we’ve moved all v3 work to a new repo located at https://github.com/microsoft/botbuilder-v3. We will continue to support and offer maintenance updates to v3 via this new repo.

From now on, https://github.com/microsoft/botbuilder repo will be used as hub, with pointers to all the different SDK languages, tools and samples repos.

As part of this restructuring, we are closing all tickets in this repo.

For defects or feature requests, please create a new issue in the new Bot Framework v3 repo found here: https://github.com/microsoft/botbuilder-v3/issues

For Azure Bot Service Channel specific defects or feature requests (e.g. Facebook, Twilio, Teams, Slack, etc.), please create a new issue in the new Bot Framework Channel repo found here: https://github.com/microsoft/botframework-services/issues

For product behavior, how-to, or general understanding questions, please use Stackoverflow. https://stackoverflow.com/search?q=bot+framework

Thank you.

The Bot Framework Team