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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Copilot Studio / SSO not working with R...
Copilot Studio
Unanswered

SSO not working with React Webchat

(0) ShareShare
ReportReport
Posted on by

I am trying to get SSO working on React webchat that is available - https://github.com/microsoft/BotFramework-WebChat and using DirectLine Secret approach to generate token and pass it. I had also got the same code to work with Javascript - https://learn.microsoft.com/en-us/power-virtual-agents/configure-sso . But looks like with React the SSO does not seem to be working and always prompt for login. Anyone here who got the react sample to work with PVA Bot. React webchat does offer lot of featutres over js chat. Hence we are inclined towards this.

 

Here is the code:

 

thisObject.directLine.postActivity({
                type: 'event',
                name: 'signin/tokenExchange',
                value: {
                    id: activity.attachments[0].content.tokenExchangeResource.id,
                    connectionName: activity.attachments[0].content.connectionName,
                    token: token,
                },
                "from": {
                    id: "Email",
                    name: "Name"
                }
              }).subscribe(
                id =>
                {
                    alert(id);
                    if (id === 'retry')
                    {
                      //document.location.reload();
                        // bot was not able to handle the invoke, so display the oauthCard
                        return next(action);
                    }
                    // else: tokenexchange successful and we do not display the oauthCard
                },
                error =>
                {
                 
                    // an error occurred to display the oauthCard
                    return next(action);
                }
The token generation seems to be fine as well. Any inputs is really appreciated.
Categories:
I have the same question (0)

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Copilot Studio

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 261 Super User 2025 Season 2

#2
Romain The Low-Code Bearded Bear Profile Picture

Romain The Low-Code... 198 Super User 2025 Season 2

#3
S-Venkadesh Profile Picture

S-Venkadesh 93 Moderator

Last 30 days Overall leaderboard