File tree Expand file tree Collapse file tree
BuildYourOwnCanvasSamples/3.single-sign-on Expand file tree Collapse file tree Original file line number Diff line number Diff line change 192192
193193( async function main ( ) {
194194
195- // Add your BOT ID below
196- var BOT_ID = "<BOT ID>" ;
197- var theURL = "https://bots.ppe.customercareintelligence.net /api/botmanagement/v1/directline/directlinetoken?botId=" + BOT_ID ;
195+ // Add your BOT ID below
196+ var BOT_ID = "<BOT ID>" ;
197+ var theURL = "https://powerva.microsoft.com /api/botmanagement/v1/directline/directlinetoken?botId=" + BOT_ID ;
198198
199+ var userId = clientApplication . account ?. accountIdentifier != null ?
200+ ( "You-customized-prefix" + clientApplication . account . accountIdentifier ) . substr ( 0 , 64 )
201+ : ( Math . random ( ) . toString ( ) + Date . now ( ) . toString ( ) ) . substr ( 0 , 64 ) ;
202+
199203 const { token } = await fetchJSON ( theURL ) ;
200204 const directLine = window . WebChat . createDirectLine ( { token } ) ;
201205 const store = WebChat . createStore ( { } , ( { dispatch } ) => next => action => {
227231 token
228232 } ,
229233 "from" : {
230- id : clientApplication . account . accountIdentifier ,
234+ id : userId ,
231235 name : clientApplication . account . name ,
232236 role : "user"
233237 }
267271 window . WebChat . renderWebChat (
268272 {
269273 directLine : directLine ,
270- store,
274+ store,
275+ userID :userId ,
271276 styleOptions
272277 } ,
273278 document . getElementById ( 'webchat' )
You can’t perform that action at this time.
0 commit comments