Can I distinguish users from different sites in ITurnContext?
See original GitHub issueThe webchat channel allows to register multiple sites having different secrets.
Imagine that a webchat is embedded on the intranet of different companies. Recognizing / authenticating users on personal level is not a requirement. However, I do want to serve them content relevant to the company that the user belongs to.
I want to avoid the companies having to use Azure AD.
The embed codes are different per site (because of different secrets). Is it possible to use this to get a “site context” somehow?
Is it possible to recognize what webchat site a user is coming from through one of the properties of ITurnContext
?
Issue Analytics
- State:
- Created 5 years ago
- Comments:22 (11 by maintainers)
Top Results From Across the Web
Can I distinguish users from different sites in ITurnContext?
It is possible to supplement outgoing messages from WebChat with additional information by configuring a custom middleware and adding data to ...
Read more >What is ITurnContext.TurnState used for and what is its lifetime?
Using the TurnState the way you described, the values will only be available for the lifetime of the turn. A turn is generally...
Read more >ITurnContext Interface (Microsoft.Bot.Builder)
An adapter that implements the Bot Framework Protocol and can be hosted in different cloud environmens both public and private. BotFrameworkAdapter class ...
Read more >Step by Step: Configure Bot to Work in Teams and with ...
This blog post is a step-by-step instruction on how to create a Bot from scratch using Microsoft Bot Framework v4, configure it to...
Read more >How to receive events in a Bot Framework SDK v4 Web API bot?
We'll add an endpoint in out BotController, so it can receive an arbitrary event directed to any user that's been interacting with the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@hansmbakker v4 of Web Chat is not available on Azure Portal (yet). If you are using an embed code, right now that means you are using v3 of Web Chat. I’ve reopened this issue and tagged @compulim and @EricDahlvang who can hopefully provide more insight. 😃
@corinagum thank you for the feedback.
Yes I was using the iframe embed option from Azure Portal, but also I have “Enable preview” checked. However it is not really clear to me that this results in usage of webchat v4 and what new features are in there.
I understand that it is better to use temporary tokens than the semi-fixed secrets. However I would expect that tokens, generated from different site secrets, are also different, and that Bot Framework could find out the site for which a token would be generated.
My goal is to know in the bot logic (so not in the user’s browser) what site the user came from. The use case for this is to have branding for different companies in the bot messages. Imagine showing a different welcome card, or other branded content, per webchat site (I am not talking about changing colors and other styling).
So to get back at the original question - I wanted to know whether it is possible to recognize the webchat site (based on token/secret), just like you could recognize an AD tenant for a user when a user is signed in through AD? Without building additional code in the browser and using the backchannel?
(Your code looks like it should be run in the browser)