Skip to content

Commit a0251f8

Browse files
authored
Merge pull request microsoft#23 from microsoft/pawant-ms-sso
Update index.html
2 parents 2fc44d6 + a4b9f94 commit a0251f8

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

  • BuildYourOwnCanvasSamples/3.single-sign-on

BuildYourOwnCanvasSamples/3.single-sign-on/index.html

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -192,10 +192,14 @@
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 => {
@@ -227,7 +231,7 @@
227231
token
228232
},
229233
"from": {
230-
id: clientApplication.account.accountIdentifier,
234+
id: userId,
231235
name: clientApplication.account.name,
232236
role: "user"
233237
}
@@ -267,7 +271,8 @@
267271
window.WebChat.renderWebChat(
268272
{
269273
directLine: directLine,
270-
store,
274+
store,
275+
userID:userId,
271276
styleOptions
272277
},
273278
document.getElementById('webchat')

0 commit comments

Comments
 (0)