Skip to main content

Notifications

Copilot Studio - General
Unanswered

Authenticating User from Vanila Cloud

Posted on by

We are working on building a chatbot where users have different personas and would be authenticated basis grouping done on the website. We have cleared this step however the issue is arising putting that code back to chatbot to call the user in PVA as the website is not a regular ipython frame or css website but it is something built on all together a different product Vanilla OSS, for reference here is the wiki link for details. 

https://en.wikipedia.org/wiki/Vanilla_Forums

Does any one know how to authenticate user who are logged into a website built on a vanilla product i.e. Vanilla OS. 

we have used the below code to pull the user credentials and need to call this back to PVA. (have made some changes to the code to whitelabel it

 

<!DOCTYPE html>

    <html>

    <head>

        <title>Name of the website</title>

        <!-- This styling is for the canvas demonstration purposes. It is recommended

    that style is moved to separate file for organization in larger projects -->

        <style>

            html, body {

                height: 100%;

            }

            body {

                margin: 0;

            }

            h1 {

                font-size: 16px;

                font-family: Font type;

                line-height: size;

                color: color to be selected;

                display: table-cell;

                padding: require dimensions;

            }

            .heading {

                background-color: desired color;

                height:  x px height;

            }

            .main {

                margin: 18px;

                border-radius: x px radius;

            }

 

            div[role="form"]{

                background-color: color;

            }        

            #webchat {

                position: fixed;

                height: calc(required height);

                width: as desired%;

                top: 50px;

                overflow: xxx;

            }

          </style>

    </head>

    <body>

        <div>

            <div class="heading">

 

                <!-- Change the h1 text to change the bot name -->    

                <h1>Name of the BOT</h1>

 

            </div>

            <div id="webchat" role="main"></div>

        </div>    

      <script src="https://cdn.botframework.com/botframework-webchat/latest/webchat.js"></script>

      <script>

            const styleOptions = {

               // Add styleOptions to customize web chat canvas

               hideUploadButton: true

            };

 

            // Add your BOT ID below

            var BOT_ID = "<ENTER YOUR BOT ID>";

 

            var theURL = "Add the URL";

 

            const store = window.WebChat.createStore(

               {},

               ({ dispatch }) => next => action => {

                   if (action.type === "DIRECT_LINE/CONNECT_FULFILLED") {

                      dispatch({

                          meta: {

                               method: "keyboard",

                           },

                           payload: {

                               activity: {

                                     channelData: {

                                          postBack: true,

                                     },

                                      //Web Chat will show the 'Greeting' System Topic message which has a trigger-phrase 'hello'

                                      name: 'startConversation',

                                      type: "event"

                                 },

                            },

                            type: "DIRECT_LINE/POST_ACTIVITY",

                       });

                 }

                 return next(action);

              }

           );

           fetch(theURL)

                .then(response => response.json())

                .then(conversationInfo => {

                    window.WebChat.renderWebChat(

                        {

                            directLine: window.WebChat.createDirectLine({

                                token: conversationInfo.token,

                            }),

                            store: store,

                            styleOptions: styleOptions

                        },

                        document.getElementById('webchat')

                    );

                })

                .catch(err => console.error("An error occurred: " + err));

        </script>

      </body>

    </html>

  • JoseA Profile Picture
    JoseA 20 on at
    Re: Authenticating User from Vanila Cloud

    I think it's best to update the post and include a Pastebin link for the code. 

     

    Have you tried using the instructions here - 

    Configure user authentication - Power Virtual Agents | Microsoft Learn 

    Configure single sign-on - Power Virtual Agents | Microsoft Learn

     

    Let us know how it goes

Helpful resources

Quick Links

Welcome to the Power Platform…

We are thrilled to unveil the newly-launched Power Platform Communities!…

Getting Started…

Welcome to the Power Platform Community! We appreciate your visit…

Welcome to the new Power Platform Community!…

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

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 138,287

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,172

Leaderboard