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 / SSO not working with R...
Copilot Studio
Unanswered

SSO not working with React Webchat

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

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

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 619

#2
chiaraalina Profile Picture

chiaraalina 163 Super User 2026 Season 1

#3
Haque Profile Picture

Haque 147

Last 30 days Overall leaderboard