0
votes

PROBLEM: When i try to access bot using WEB Embedded code IFrame.

Sample Embedded IFrame :<iframe style='min-width: 400px; width: 100%; min-height: 500px;' src="https://webchat.botframework.com/embed/intermediatorbotsample2019?t=ew0KICAiYWxnIjogIlJTMjU2IiwNCiAgImtpZCI6ICJSNHZYc3c3bGFUbjFaa25SUUJ1VlBGWno3WE0iLA0KICAieDV0IjogIlI0dlhzdzdsYVRuMVprblJRQnVWUEZaejdYTSIsDQogICJ0eXAiOiAiSldUIg0KfQ.ew0KICAiYm90IjogImludGVybWVkaWF0b3Jib3RzYW1wbGUyMDE5IiwNCiAgInNpdGUiOiAiR2hxaDZibGtvd0kiLA0KICAiY29udiI6ICI5SzhDbmxFMHA1bDZJVEphYVA4Sk1JIiwNCiAgIm9yaWdpbiI6IFsNCiAgICAiaHR0cHM6Ly9iNDM5YzRjMi5uZ3Jvay5pbyIsDQogICAgImh0dHA6Ly9iNDM5YzRjMi5uZ3Jvay5pbyIsDQogICAgImh0dHBzOi8vd3d3Lnczc2Nob29scy5jb20iDQogIF0sDQogICJuYmYiOiAxNTQ5ODY5NDUyLA0KICAiZXhwIjogMTU0OTg3MzA1MiwNCiAgImlzcyI6ICJodHRwczovL3dlYmNoYXQuYm90ZnJhbWV3b3JrLmNvbS8iLA0KICAiYXVkIjogImh0dHBzOi8vd2ViY2hhdC5ib3RmcmFtZXdvcmsuY29tLyINCn0.h4iKrAZnZ3xN0czwtz09Qg8KnqkJpRLZ17Lxcp7oTuUMvhXiBc0tgDOBDQOIQgBPqe3xGWPiDROe3HvcmFS5BXow7KnwqvaLQLOle2SHo_YphJTtnXncHJXta8zmFJY_EPdLHcteUHlO4vjA1JM9WFfVnrPX5C4MxE9Zb-L8WNd0GhG7K4R40MZ7hdUcxaLahrLjog5e0C_FOlf46LP8qWf6LAKoqnqCwhPoPhbRcSh7sWUSW7pDbj-CPSiy6c7d0l9lBi-J8nWksof_6UYD9qxh4D7c4dc_y12zGh0yHwoQrteOf_T9JuQ31PkzRQdI94iep0AlB7c-NsNAkJylnw"></iframe>

Microsoft azure bot channel issues error say's: Http status code forbidden. (image) Log's Azure channel show error issue

  • Successfully tested the bot locally using the bot emulator(with deployed bot api endpoint)
  • Successfully tested on emulator with bot Api and Password
1
Are you generating the token after every conversation, because a single token will work only for one conversation, to start new you'd have to call the API again to get the new code.Gunjan Raval
Yes i am generating token for each instance of embedded Bot IFrame conversation. using new XMLHttpRequest(); xhr.open('GET', "webchat.botframework.com/api/tokens", true); xhr.setRequestHeader('Authorization', 'BotConnector ' + 'YOUR SECRET HERE'); xhr.send(); xhr.onreadystatechange = processRequest; function processRequest(e) { if (xhr.readyState == 4 && xhr.status == 200) { var response = JSON.parse(xhr.responseText); document.getElementById("chat").src="webchat.botframework.com/embed/…Pranav Dhundhia

1 Answers

0
votes

I'm not sure what you've got there, it looks like a token. The webchat iFrame uses the secret given on the channel configuration page of Azure:

    <iframe src='https://webchat.botframework.com/embed/JJQnANodeBot?s=YOUR_SECRET_HERE'  
style='min-width: 400px; width: 100%; min-height: 500px;'></iframe>

That part you have

intermediatorbotsample2019?t=

needs to read:

intermediatorbotsample2019?s=