Closed mattcobb closed 4 years ago
My copy of the sample attached, minus my bot password and the node_modules dir: 18.bot-authentication.zip
Hi @mattcobb!
Sample 18 is not the best choice if you're looking for an example of how to set up OAuth in Teams. We have Sample 46. Teams-Auth that was designed around correcting the problem you describe.
In particular: the Oauth card sends an Invoke Activity to the bot, instead of the Event Activity used in every other channel. This Invoke Activity must be forwarded to the dialog, but doesn't if you're using the standard ActivityHandler.
Sample 46 does this by extending TeamsActivityHandler instead, from botbuilder in the DialogBot class. In sample 18, DialogBot only extends the standard ActivityHandler.
Please give sample 46 a look over, and if you have further questions concerning bots, samples, bot oauth or integrating a bot with Teams, please feel free to open a new issue.
Thanks for looking into that. I tried the other sample and it works fine. It also works in "Test in WebChat"
Hi @mattcobb!
Sample 18 is not the best choice if you're looking for an example of how to set up OAuth in Teams. We have Sample 46. Teams-Auth that was designed around correcting the problem you describe.
In particular: the Oauth card sends an Invoke Activity to the bot, instead of the Event Activity used in every other channel. This Invoke Activity must be forwarded to the dialog, but doesn't if you're using the standard ActivityHandler.
Sample 46 does this by extending TeamsActivityHandler instead, from botbuilder in the DialogBot class. In sample 18, DialogBot only extends the standard ActivityHandler.
Please give sample 46 a look over, and if you have further questions concerning bots, samples, bot oauth or integrating a bot with Teams, please feel free to open a new issue.
The link you provided is dead. I'm running into the same issue, except i'm using the python code sample from here, as pointed out in the Add authentication to your Teams bot documentation. Could you point me to the right Python code sample for Teams bot authentication?
I found a working sample in the archive folder. It would seem the solution @jwiley84 mentions is not present in the code sample linked on the official MS documentation page.
Sample information
Describe the bug
Authentication to Okta OAuth2 works fine through the Azure portal "Test in Web Chat". When used from MS Teams app, the bot sets a 501 in botFrameworkAdapter.js:748 . InvokeResponse is undefined so it sets 501.
To Reproduce
Steps to reproduce the behavior:
Do I miss some setup for this to work in MS Team App. I get the same behaviour at teams.microsoft.com. Only Test Web Chat completes the login from the Azure portal.
Expected behavior
At step 13 above, I expect to be logged in and have access to the OAuth Access Token available.
Screenshots
[bug]