Unable to post to a test connector's webhook url - microsoft-teams

After setting up a connector pretty much as described in the connector tutorial, we're not able to send test requests to the webhook url we received from the connector configuration page.
The test connector is set up in the Connectors Developer Dashboard. Not published to the app store, as still testing. The message next to the connector name says "Registered. Pending Approval"
It's sideloaded to Outlook / Microsoft Teams
It's also uploaded separately as a package into Teams
It shows up correctly in the channel configuration
Connector Settings page loads correctly, and settings can be saved
The getSettings call returns a webhook url correctly
But, submitting a POST request to the webhook url errors out:
curl -d "test=true" -X POST 'https://outlook.office.com/webhook/09f2b8e5-e684-4e87-8838-75e3a2f9dcbc#00d35244-2e42-4af7-a1ad-d6b557249c2b/58f4ab6b-234c-43ad-82f0-4641e38699e0/c516d999fec5498e9cac06f8d0478f22/79e349e1-47da-487a-90ee-040eccbbfa8b'
Unknown Connector provider 58f4ab6b-234c-43ad-82f0-4641e38699e0
This seems like an issue with testing webhook urls not being usable?
Related thread as another team is having the same issue as well, and github issue with more details.
As a side-note, when adding the connector to the team page, there was a chat notification that the user added the connector to this team. In this message the connector image did not load properly. I can see in the url that it also has the connector id in it.

This seems to have been an issue within MS Teams, and it looks like it has been fixed by now. I'm able to post messages to the generated webhook without receiving the error message.

Related

Incoming webhook URL gets auto-removed

I'm completely new to slack development and I might sound crazy here.
This is what I have noticed. Whenever I use my incoming webhook URL to test messages using postman, it works fine. BUT, when I use it in my app and push the code in github (so it deploys to heroku), the incoming webhook gets removed. Is this something expected and that I missed reading in the documentation?
Ok, got answer to this. Basically, got an email from slack explaining the reason.
We recently discovered a publicly accessible incoming webhook associated with the Journey Alert Bot app installed on your sync.slack.com workspace. This can happen when someone who created or has access to a webhook URL posts it on a public site, such as Github or other code-sharing forums. None of your data is at risk — webhooks can only send messages into Slack and cannot access any data.

Bot Framework dotnet Slack adapter fails to verify Slack request when changing the Events Request Url

I have a Slack bot that is working fine and interacting with users. I'm using Bot Framework composer and the Slack Adapter.
In the Slack API portal I'm trying to change the Events Request Url the app uses to send Slack Events to my bot.
When I do that, slack sends a challenge request to my bot. The bot first tries to verify that the request is really coming from Slack following: https://api.slack.com/authentication/verifying-requests-from-slack#a_recipe_for_security
The problem is that this is failing and I can't understand why.
I see that Slack is sending all the right content, and that the ClientSigningSecret is being read, otherwise the other calls to the bot wouldn't work.
I know it's a bit far fetched to ask this since it seems to be a problem on my side. But since the bot is validating the requests just fine when users talk to the bot, and the code is from the Slack Adapter which is open source and there's nothing else I can thing of..... maybe someone struggled with the same problem.
I created a support ticket to Slack and they came back pretty quickly.
Pre publish state
Before publishing a Slack app the only configs that exist are the ones you see in the App configuration page. Those are what you use to test your app, this includes the secrets to authenticate the incoming messages from Slack into your backend.
After you publish your Slack App for the first time
Once your app is published, the production version that your users use will see the original settings, including the secrets and these are the ones your backend will get.
The settings you see in the configuration page are like development mode and they won't be persisted into the published app until you request Slack to approve your changes. That's sounds great and is what one would expect, but what you don't see and have no way of imagining is happening is that there are some development time secrets that are different from the ones you see on the settings screen.
When you change the endpoint url to be sent to your backend so that it can return the challenge and Slack would accept the new url, the message payload goes with this development secret and not the one you configured your backend with. Thus your backend will reject the call since it thinks it's not coming from Slack.
Proposed solution from Slack
Don't validate the signature of the incoming request for this type of call in an already published app. I don't like it but there was no other workaround unless Slack changes this. So what I did was:
Remove that check only for this request from the backend and publish to production.
Make the url change in Slack.
Revert the change from the backend.
:(

Teams Webhook gives ReflectionTypeLoadException

Is the webhook connections broken in Microsoft Teams or how do we solve the following issue?
When applying the Microsoft Teams Get Started documentation we get the following response in Postman.
"System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information."
We have set up a webhook in Teams and use it to post Application Insights messages to a Logic App where one of the actions is the webhook to Teams. Everything went fine until now (7/21 and 7/22, 2019) when we saw in Azure the same exception as a response on status 200. To figure this all out we went back to basic and tried to execute the Get Started documentation. The same exception was thrown.
Code that we used was all from the documentation.
After a day or two the exception wasn't returned anymore after NO modifications to the logic app or payload to the Teams webhook. Everything works fine now.
For future use we added an action to the Logic App to read out the webhook's response to determine futher actions, like sending an e-mail if webhook failed.

Tried code from Microsoft.Bot.Sample.AadV2Bot but even locally get AADSTS50011 (reply url doesn't match)

I've integrated the Code from Microsoft.Bot.Sample.AadV2Bot in my own bot but the GetTokenDialog call always results in error "AADSTS50011: The reply url specified in the request does not match the reply urls configured for the application: 'MYBOTSAPPID'"
As far as I understood, I do not have to register my bot in Azure Portal under "Azure Active Directory" but setup the Reply URL in the application registration Portal (https://apps.dev.microsoft.com) - Correct?
But whatever values I enter here, it won't work, neither locally via Emulator nor via Web. Furthermore, in MS Teams the signin Dialog does not work at all.
I've already tried these reply URLs without success:
https://MYBOTSNAME.azurewebsites.net, http://localhost:3978 and https://localhost:44362
I also tried to extend these with /api/messages, /signin-oidc and several other combinations, all without success.
The mentioned sample solution also does not include more keys than ConnectionName, MicrosoftAppId and MicrosoftAppPassword in web.config, so I haven't got a clue which redirect URI is taken on runtime.
In Azure Portal I've created an Azure Active Directory V2 Connection on my bot and entered my bot's Microsoft App ID in the field "Client ID" and Microsoft App Password in the field "Client Secret" - is this correct?
Any hint what I might have done wrong is VERY welcome!!
I finally could solve the Reply URL mismatch problem myself. Had to enter this Reply URL on my app in the application Registration Portal to make it work locally, via Emulator:
https://token.botframework.com/.auth/web/redirect
Still, the authentification Dialog (GetTokenDialog class from Microsoft.Bot.Builder.Dialogs) doesn't popup when I use MS Teams as channel.
Does anyone have an idea what could help?

How can I setting webhook callback url for Bot Framework (Skype)?

I need to setting URL for a service that was been receive event for new messages. According to Microsoft documentation I can set the url for, e.g., Facebook (https://learn.microsoft.com/en-us/azure/bot-service/bot-service-channel-connect-facebook?view=azure-bot-service-3.0#generate-a-page-access-token), but I can't find information about setting url for Skype.
But I can specify a message endpoint for my bot. The message endpoint is a webhook url?
Sorry for my bad English
See also: Messaging Webhook for Microsoft skype bot
PS: about web hooks for Skype: https://msdn.microsoft.com/en-us/skype/trusted-application-api/docs/webhooks
I'm not sure if you are using C# or node but I will try my best to answer both.
The Webhook is just the endpoint for your calling controller in C# so for example in the sample from the botbuilder repository in C# They are using the CallController.cs Your webhook would be https://{your site}/api/call.
In the sample from node they are using server.post('/api/calls', connector.listen()); so your webhook url would be https://{your site}/api/calls in this setup

Resources