Skip to main content

Notifications

Copilot Studio - General
Answered

How to configure SSO on a intranet page (SharePoint)

Posted on by

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 

https://docs.microsoft.com/en-us/power-virtual-agents/configure-sso#:~:text=Power%20Virtual%20Agents%20supports%20single,is%20already%20signed%20in%20to.&text=SSO%20is%20only%20supported%20for%20Azure%20Active%20Directory%20(Azure%20AD).

 

GitHub Sample code doc

https://github.com/microsoft/PowerVirtualAgentsSamples/blob/master/BuildYourOwnCanvasSamples/3.single-sign-on/index.html


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.

 

pva1.png

 

I have also posted regarding the same in the past as well. But no luck. Any help is much appreciated. 

 

Regards,

Hemanth

  • h4tgdev Profile Picture
    h4tgdev 8 on at
    Re: How to configure SSO on a intranet page (SharePoint)

    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

     

     

  • Re: How to configure SSO on a intranet page (SharePoint)

    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

  • h4tgdev Profile Picture
    h4tgdev 8 on at
    Re: How to configure SSO on a intranet page (SharePoint)

    @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

     

  • neeraja Profile Picture
    neeraja 14 on at
    Re: How to configure SSO on a intranet page (SharePoint)

    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!

  • Re: How to configure SSO on a intranet page (SharePoint)

    @neeraja 

     

    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.

  • Re: How to configure SSO on a intranet page (SharePoint)

    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.

  • skandadai Profile Picture
    skandadai 8 on at
    Re: How to configure SSO on a intranet page (SharePoint)

    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.

  • neeraja Profile Picture
    neeraja 14 on at
    Re: How to configure SSO on a intranet page (SharePoint)

    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?

  • neeraja Profile Picture
    neeraja 14 on at
    Re: How to configure SSO on a intranet page (SharePoint)

    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.

     

     

  • skandadai Profile Picture
    skandadai 8 on at
    Re: How to configure SSO on a intranet page (SharePoint)

    @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.

Helpful resources

Quick Links

Exciting News for Copilot Studio Communi…

Get ready to experience a whole new level of engagement with the Copilot Studio…

Celebrating the May Super User of the…

LaurensM is an exceptional contributor to the Power Platform Community…

Check out the Copilot Studio Cookbook…

We are excited to announce our new Copilot Cookbook Gallery in the Community…

Leaderboard

#1
renatoromao Profile Picture

renatoromao 6,459

#2
Pstork1 Profile Picture

Pstork1 1,995

#3
Expiscornovus Profile Picture

Expiscornovus 1,700

Leaderboard