cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
aksridhar1
Advocate II
Advocate II

SSO not working with React Webchat

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.
0 REPLIES 0

Helpful resources

Announcements
Power Virtual Agents News & Announcements

Power Virtual Agents News & Announcements

Keep up to date with current events and community announcements in the Power Virtual Agents community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Virtual Agents Community Blog

Power Virtual Agents Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (2,274)