-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set the user name in from in new version #1321
Comments
We obsoleted the user name in the UI and prefer using avatar initials. Do you think a customizable timestamp will work for you? |
Currently I set the user name to the logged in user's Azure AD username to pass this to the bot to use it in some searches. Basically I need a way to do that in the new version. I don't need it displayed just passed to the bot. I could pass it in the back channel but would prefer not to because that would require saving it. Thinking about it a bit more I could probably use the user ID instead. Is there a reason not set that to a username such as "[email protected]"? |
You mean why we don't set user ID to [email protected]? This blog post explain about "tamper-proof user IDs", https://blog.botframework.com/2018/09/01/using-webchat-with-azure-bot-services-authentication/. The main idea is an unguessable and unforgeable user ID. Sorry it's so hidden in our docs. |
So it seems the best way to get the user's email would be through the back channel then? And then in the bot save this and access the saved value when needed. |
Your approach would work, using a database to associate Direct Line user ID and email. When I code bot, I try to make them as stateless as possible (for cost cautious and latency). So I am throwing another approach so you can weigh between them. The another approach, I am outlining in this sample is using Redux middleware to inject email in the Since this approach is similar to HTTP cookies, it will lower your server load with slightly bigger traffic. I just baked this sample and it is still in PR. This sample requires a little change in our existing code. So expect it to drop publicly in 4.2 (mid-December). You can always use our development build (after PR merged) if you need it quick, probably within a few days. |
Closing due to inactivity |
I was able to set the user ID in the new version of web chat, but I can't figure out how to set the user's name. I've got some logic that relies on the user's name in a bot and need to set this before migrating to webchat v4. Is there a way to set this?
The text was updated successfully, but these errors were encountered: