Jano
Jano

Reputation: 731

Bot Framework always getting unauthorized response

I started using Microsoft Bot Framework and followed step by step all tutorials. I has been able to register a new bot and to deploy it working good with emulator, but except it nothing else works. Test connection to your bot chat do not works despite I get answer from emulator and from all connected channels, that where created and registered properly I always get an Unauthorized response or something like that, anyway no response, so nothing works. I tried with Twilio, Web Chat, Telegram (Skype auth is pending) getting always the same response. As it seems I strictly followed the tutorials, is there something else to do or to be approved? Or just the service is still not working at 100% as too young?

Thanks

Upvotes: 5

Views: 6407

Answers (7)

DaxFishing
DaxFishing

Reputation: 11

Make sure that you republish your bot service after registering and getting the app Id and password. If you fail to do this you will get Unauthorized. The steps are 100% clear on this and I hit this for a minute.

Upvotes: 0

Ajit
Ajit

Reputation: 31

Hi I was facing same problem to work bot locally in v3. I just made everything blank in web.config and it is working.

Upvotes: 3

PaulTheCyclist
PaulTheCyclist

Reputation: 1276

Took me a while to get it working locally too. Oddly for me it only works when those 'secret' fields are empty, as mentioned and running in debug. Running without debugging seems to always result in a 401

Upvotes: 3

Jim Lewallen
Jim Lewallen

Reputation: 1006

I've cleaned up the getting started with the following; hopefully it will make it clearer for the next person who uses it:

Click the “Register a Bot” button and fill out the form. Many of the fields on this form can be changed later. Use a the endpoint generated from your Azure deployment, and don’t forget that when using the Bot Application template you’ll need to extend the URL you pasted in with the path to the endpoint at /API/Messages. You should also prefix your URL with HTTPS instead of HTTP; Azure will take care of providing HTTPS support on your bot. Save your changes by hitting “Create” at the bottom of the form.

Upvotes: 2

Jano
Jano

Reputation: 731

I solved the problem. It was related to https. It's not well explained into tutorial but when you create and publish a service in Azure it is created as http://XXXXXXX.azurewebsites.net as shocased into tutorial, but it will not work as your service must run in https. I so used https://startssl.com to create a free ssl certificate then turned on SSL into my Azure service so everything started working.

Upvotes: 2

Lars
Lars

Reputation: 10573

Make sure you are using HTTPS. BotFramework will not work with basic auth so tokens are not passed in the clear.

See: http://docs.botframework.com/connector/calling-api/

Upvotes: 1

T Laird-McConnell
T Laird-McConnell

Reputation: 416

If you are using HTTP you need to disable basic auth because the connector won't send your appSecret in the clear.

The solution is to make sure you register as HTTPS, or if you need to use HTTP then disable the basic auth.

Upvotes: 3

Related Questions