Hello Community ,
I am stuck with a requirement where I need users from different client to login to Copilot but using Azure Active directory I am unable to achieve it , So I have chosen to go with Generic OAuth ,which works perfectly fine from Bot side but whenever I am trying to sign in to bot using Custom canvas (directline api) I am not able to do so .
if (activity.from && activity.from.role === 'bot' &&
(resourceUri = getOAuthCardResourceUri(activity))) {
exchangeTokenAsync(resourceUri).then(function (token) {
if (token) {
directLine.postActivity({
type: 'invoke',
name: 'signin/tokenExchange',
value: {
id: activity.conversation.id,
connectionName: activity.attachments[0].content.connectionName,
token
},
"from": {
id: userId,
name: clientApplication.account.name,
role: "user"
}
}).subscribe(
id => {
console.log(id)
if (id === 'retry') {
return next(action);
}
},
error => {
return next(action);
}
);
return;
}
else
return next(action);
});
So if you guys having any idea how to achieve the following , it will be helpful !