Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Copilot Studio - General
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:

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Copilot Studio - General

#1
Ekta Gupta Profile Picture

Ekta Gupta 4

#2
ricardodesouza Profile Picture

ricardodesouza 2

#2
L-1234567-0 Profile Picture

L-1234567-0 2

Overall leaderboard