microsoft / BotFramework-WebChat

A highly-customizable web-based client for Azure Bot Services.
https://www.botframework.com/
MIT License
1.58k stars 1.53k forks source link

How to pass userid info thru Directline using ReactJS #1865

Closed dharanidharan closed 5 years ago

dharanidharan commented 5 years ago

Hi,

i have created voice chat bot, using web chat sample. It working fine. Now, i have to pass the user id thru CreateDirectline. Am not able to get any user id variables in CreateDirectLine.Js; its contain below mentioned variable alone

domain: domain, fetch: fetch, secret: secret, token: token, webSocket: webSocket;

Am a .Net developer. its my first react app. Please suggest how to pass user id or user name in Directline react.

cwhitten commented 5 years ago

Hello @dharanidharan - please see the WebChat README or the samples to see examples of passing a user id into WebChat. If you are using react, you can use the React component with the same api shown in what I linked.

mailforsachin commented 5 years ago

@cwhitten Chris, could you explain this "If you are using react, you can use the React component with the same api shown in what I linked." I am using sample 12 and the react app is working as expected. But now, I need to pass the userid and password. How can I accomplish this? To give you a background, I have now hosted MSWebchat on ServiceNow portal page. I need some sort of SSO where I can pass on the user email and ID from the background/end ServiceNow page to the react application.