web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Copilot Studio / Authenticating User fr...
Copilot Studio
Unanswered

Authenticating User from Vanila Cloud

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

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>

Categories:
I have the same question (0)
  • JoseA Profile Picture
    20 on at

    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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Copilot Studio

#1
Valantis Profile Picture

Valantis 572

#2
Haque Profile Picture

Haque 154

#3
chiaraalina Profile Picture

chiaraalina 144 Super User 2026 Season 1

Last 30 days Overall leaderboard