Hi,
I have been trying to configure SSO on our organization SharePoint website using PVA. But I don't see it to be working. I have been referring to the below URLs:
SSO doc
GitHub Sample code doc
I have created a HTML file adding the SSO code provided from the above doc and published in the SharePoint website. I do not wish to see the login sign in card which asks to pass the token rather I need to Sign-in directly once I click the Chatbot button.
I have also posted regarding the same in the past as well. But no luck. Any help is much appreciated.
Regards,
Hemanth
Hello @Anonymous
Thanks for the pointer I didn't realize the code was in this thread. I have most of it working but I am getting this error:
index.html:310 Uncaught (in promise) ReferenceError: $ is not defined
at index.html:310:11
This is the line that is failing:
$("#divPopup").modal({ backdrop: "static", keyboard: false });
If I comment this line out it does a redirect to get the auth and it works (This scenario is using a static website via azure storage).
My goal is to put this code in a PowerApps Portal and when I remove this line it redirects me to the sign in but after i sign in it keeps sending me back to the sign popup.
thanks
thanks
Hello @h4tgdev
Let me know what is the error you are getting. The code is already posted as part of this thread. Please see the thread from beginning
Sridhar
@Anonymous
Hi
I am having an issue with SSO. Would you mind posting the code for the index.html you used here so i can compare it to what i have done?
thanks
I am able to achieve the SSO with the custom canvas HTML hosted at azure web app. The modification I did is there is no need of 2 app registrations. I have only used one app registration in that I have given token URL and my custom canvas hosted URL.
It works fine!
Can you provide few snapshots of the issue that your facing.
For the Authentication app registration on Azure you have to pass https://token.botframework.com/.auth/web/redirect as the redirect url.
For the SSO Canvas app registration on Azure you have to pass the Bot hosted page.
Hi @neeraja
You don't have to add extra code for the image.
<img id="myBtn" alt="image" src="<Add image url>">
You just have to pass the image url to the above code and where ever required.
You also need to add the sharepoint homepage where this bot will be hosted as the MSAL javascript code needs to create a new token and redirect. If you dont add then redirection will fail with above error.
Hi,
Let me provide the steps i have followed for this SSO configuration
1. I have created chat bot and then by using that bot ID i have created custom canvas using HTML page then hosted that in azure web app
2. created app registration for this canvas azure web app and the redirect URL I have given here is Token URL
https://token.botframework.com/.auth/web/redirect
3. Created another app registration say bot app and the redirect URL I used here is custom canvas web app and added custom canvas app client info in this app.
4. then finally added bot app client ID and details at power virtual agent chat bot.
5. then added custom HTML code given at Microsoft article in the custom canvas HTML page.
Then I try to run the page.. it shows me below error
Sorry, but we’re having trouble signing you in.
AADSTS50011: The reply URL specified in the request does not match the reply URLs configured for the application: '6c43d77b-e66e-446c-b334-36fe23d73be1'.
can anyone pls help me to get solved this error?
Hi,
If I see the redirect uri from this url.. it clearly says the URL where our chat canvas is hosted. I understand my chat canvas is hosted at sharepoint home page, so i have given that. The code hemanth sent to me shows also same..
redirectUri:"<Add SharePoint url where your bot is deployed>",
Let me know if it is wrong?
I have other question regarding this
4. Try accessing your bot through a button/image i.e. place a button/image in the code which helps to pop-up the chat bot window when clicked on it. - This one need to write extra code other than what you have given?
pls advise.
@neeraja - The code creates a new session using MSAL and uses that to send message via the bot. To make the user experience better, always provide the same page on which you added the javascript as the redirection page so that it will redirect back to this page. The redirect uri should not be any other page. Hope this helps.
stampcoin
6
Artur Stepniak
5
Super User 2025 Season 1
Michael E. Gernaey
4
Super User 2025 Season 1