botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

Issue with Web Chat component

Open jamesemann opened this issue 10 years ago • 7 comments

Not sure if this is the right place to post... but here goes...

First of all the SDK is excellent, great work everyone involved.

My bot works in the emulator, but I have come across a snag when I try to embed a web chat onto my page. As far as I can see, I have configured everything appropriately, enabled the web chat channel in the bot portal, but when I use the web chat, the bot is not responding.

see example

Note this happens inside an iframe and if i navigate to the URL directly. Looking inside fiddler I can see that I am getting a 403 forbidden from the endpoint https://webchat.botframework.com/api/conversations. (error detail: "Missing token or secret").

jamesemann avatar Mar 31 '16 11:03 jamesemann

I have the same error - cannot embed bot into the site. I've tried both options: iframe with secret and with token. 503 in first case and cross-origin request in second

gbdrm avatar Mar 31 '16 11:03 gbdrm

Just for info... I've tried both options as well,

I think https://webchat.botframework.com/api/conversations needs to support the CORS preflight for this to work.

jamesemann avatar Mar 31 '16 12:03 jamesemann

I think the embed url that gave us is wrong. the BuildBot's embed url is using token with t=xxxxxx. however, the embed Url is using secret (s=xxxx). and that's the reason why getting 403.

chgc avatar Mar 31 '16 15:03 chgc

@chgc There should be 2 options how is it possible to embed chat control: http://docs.botframework.com/connector/embed-chat-control/#navtitle One option with secret (s=..) and another one with token (t=...)

Anyway, both options don't work for me

gbdrm avatar Mar 31 '16 16:03 gbdrm

Sample that doesn't work: https://questbot.azurewebsites.net/

gbdrm avatar Mar 31 '16 16:03 gbdrm

ok, i got it to work. the changes I made are

  1. change s=xxx => t=xxxx
  2. make sure Endpoint url is using https://xxxx.xxxx

chgc avatar Mar 31 '16 16:03 chgc

Thanks @chgc changing s= to t= works now.

For clarity and anyone who comes across this in future, the embed needs to use t= with a secret not a token.

This does contradict the documentation here which says the indended use of t= should be for a one time token.

jamesemann avatar Mar 31 '16 17:03 jamesemann