Skip to main content

Notifications

Community site session details

Community site session details

Session Id : bviS4x1XADpX9FkjmEfj/x
Copilot Studio - Bot Extensibility
Suggested answer

Dynamics Customer Service Live Chat widget - SSO Issue

Like (1) ShareShare
ReportReport
Posted on 15 Nov 2024 07:07:54 by 49
I'm working on implementing SSO within the Dynamics Live Chat widget.
Here's my code snippet
 
    const signInIds = [];
    window.Microsoft.Omnichannel.LiveChatWidget.SDK.setBotAuthTokenProvider(async (botTokenUrl, callback) => {
      const urlSearchParams = new URLSearchParams(botTokenUrl);
      const signInId = urlSearchParams.get("state");
    
      if (signInIds.includes(signInId)) { // Ignore authenticated sign-in cards
        callback({show: false});  // Hide card
        return;
      }
    
      signInIds.push(signInId);
    
      const authUrl = ""; // Customer's Authentication API
      const authResponse = await fetch(authUrl, method: "POST"});
      const {token} = authResponse;  // Customer's Auth Token
    
      const data = {
        token: "token"
      };
    
      const payload = {
        method: "POST",
        headers: {
          "Content-Type": "application/json"
        },
        body: JSON.stringify(data)
      };
    
      try {
        const botAuthResponse = await fetch(botTokenUrl, payload); // Posts Auth Token to Bot directly
        
        // Sign in through Bot is successful
        if (botAuthResponse.status === 200) {
          signInIds.push(signInId); // Track authenticated sign-in card
          callback({show: false}); // Hide card
        }
    
        if (botAuthResponse.status === 404 || botAuthResponse.status == 202) {
          callback({show: false}); // Hide card
          return;
        } else {
          // Other condition handling    
        }
    
        return;
      } catch (error) {
      
      }
    
      callback({show: true});  // Show sign-in card by default
    });

However, I'm having trouble hiding the default login card that appears from Copilot. Do you have any workarounds for this?
 
  
 
Categories:
  • Suggested answer
    Artur Stepniak Profile Picture
    1,521 Super User 2025 Season 1 on 03 Dec 2024 at 11:42:09
    Dynamics Customer Service Live Chat widget - SSO Issue
    Hello,
     
    maybe the Sign In topic is the issue here?
     
     
    Have you tried to disable it?

    In case of any other questions, let me know. If the answer helped you, mark it, so that others can benefit from it.

    Best regards,

    Artur Stepniak
  • Sohom Rik Profile Picture
    49 on 03 Dec 2024 at 11:34:20
    Dynamics Customer Service Live Chat widget - SSO Issue

    Hi Artur Stepniak,

    The authentication has been set up correctly as per the documentation, and silent authentication is functioning as expected. However, there's an issue where the Login card appears immediately, without waiting for the bot authentication process to complete. Interestingly, after the initial occurrence, it works as intended from the second attempt onward.

    Let me know if you need more details!

  • Suggested answer
    Artur Stepniak Profile Picture
    1,521 Super User 2025 Season 1 on 03 Dec 2024 at 11:20:08
    Dynamics Customer Service Live Chat widget - SSO Issue
    Hello,
     
    what's the configuration of the Copilot? Is it set to manually authenticate? If yes, is the configuration properly maintained as per docs?
     
    In case of any other questions, let me know. If the answer helped you, mark it, so that others can benefit from it.
     
    Best regards,
     
    Artur Stepniak

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

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 - Bot Extensibility

Overall leaderboard

Featured topics

Loading started