BotFramework-WebChat
BotFramework-WebChat copied to clipboard
URL origin webchat
Hi,
Has a way to get the URL origin webchat (URL from browser that send and receive the messages). I need validate if the URL origin is the URL that instanced the BotFramework.
If I use for example (origin):
BotChat.App({
directLine: { secret: '{directline_secret}' },
user: { id: '{user_id}', origin : window.location.href},
bot: { id: '{bot_id}' },
}, document.getElementById('bot'));
It can be changed in browser, I need get it from header.
Thank you!
Could anyone help?
I need it too !!
There aren't any secure solution if you are passing it in JavaScript. Maybe you can post it in BotBuilderSDK and ask them for a better solution.
If you are using token (instead of secret, and is generated on the server-side), I think you can use CORS to secure your URL origin.