cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
nportillo
Microsoft
Microsoft

Connect SSO in PVA

Hello community looking for help.

I am trying to connect SSO in PVA on the Sharepoint website

 

I followed all the steps described here Configure single sign-on - Power Virtual Agents | Microsoft Docs and while I can see that the bot briefly calls SSO for authentication it looks like that call get override by regular token authentication (asking for a code) and can't find the error.

 

nportillo_0-1633488236733.png

 

I added to my SharePoint this code but it doesn't replace the code authentication with SSO. What I am doing wrong? This is the modified code that I added to Sharepoint


<!DOCTYPE html><html><head>
<script>
var clientApplication;
(function () {
var msalConfig = {
auth: {
clientId: '5ad6f08d-ab16-45b9-892b-f892e1740c1b',
authority: 'https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47'
},
cache: {
cacheLocation: 'localStorage',
storeAuthStateInCookie: false
}
};
if (!clientApplication) {
clientApplication = new Msal.UserAgentApplication(msalConfig);
}
} ());
</script>
<body><script>
function getOAuthCardResourceUri(activity) {
if (activity &&
activity.attachments &&
activity.attachments[0] &&
activity.attachments[0].contentType === 'application/vnd.microsoft.card.oauth' &&
activity.attachments[0].content.tokenExchangeResource) {
// asking for token exchange with AAD
return activity.attachments[0].content.tokenExchangeResource.uri;
}
}

function exchangeTokenAsync(resourceUri) {
let user = clientApplication.getAccount();
if (user) {
let requestObj = {
scopes: [resourceUri]
};
return clientApplication.acquireTokenSilent(requestObj)
.then(function (tokenResponse) {
return tokenResponse.accessToken;
})
.catch(function (error) {
console.log(error);
});
}
else {
return Promise.resolve(null);
}
}
</script>
<iframe src=https://web.powerva.microsoft.com/environments/839eace6-59ab-4243-97ec-a5b8fcc104e4/bots/new_bot_267... frameborder="0" style="width: 100%; height: 100%;">
</body></head></html>

 

Any help is highly appreciated @ximenav

4 REPLIES 4
saadzagh
Frequent Visitor

The reply url configured in the app registration should be the web page url hosting the bot, and not the token.botframwork.com.

nportillo
Microsoft
Microsoft

Hi, agree but that is my problem, I can't find a way to update or bypass that canvas 😞

 

Hi,

 

Here is two things to be considered to have SSO working:

The reply URL should be the sharepoint url. If you are receiving the code it is because you are using the token.botframework.com

Was your bot created on dev environnement then exported/imported to another environnement? If Yes I have the same problem, my bot works perfectly with SSO on Dev env, but not on test Env.

 

What do you mean by "cannot find a way to update"? as I said the URL could be modified on Azure > App registration.


Hi thanks for the follow up, I do see this in my App registration view. It is currently pointing to my desired sharePoint

nportillo_0-1633976733789.png

Is this the right place or there is another place where I need to make sure?

Helpful resources

Announcements
Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Center-of-Excellence-Starter-Kit-cropped 768x460.png

The Total Economic Impact™ of Power Virtual Agents

Read this 2021 commissioned study, conducted by Forrester Consulting.

Users online (2,403)