BotFramework-WebChat icon indicating copy to clipboard operation
BotFramework-WebChat copied to clipboard

URL origin webchat

Open eskivelevolution opened this issue 8 years ago • 2 comments

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!

eskivelevolution avatar Apr 25 '18 18:04 eskivelevolution

Could anyone help?

I need it too !!

alexvingg avatar Apr 26 '18 20:04 alexvingg

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.

compulim avatar Jun 14 '18 10:06 compulim