Skip to content

[#482] Manual Authentication failing on test-agents/copilotstudio-webchat#504

Merged
rido-min merged 3 commits intomainfrom
southworks/fix/csc-webchat-allow-card
Aug 11, 2025
Merged

[#482] Manual Authentication failing on test-agents/copilotstudio-webchat#504
rido-min merged 3 commits intomainfrom
southworks/fix/csc-webchat-allow-card

Conversation

@ceciliaavila
Copy link
Copy Markdown
Collaborator

Fixes #482
Fixes #450

Description

This PR fixes an issue in copilotstudioclient where only activities with text were supported.
The activity generated for the Office 365 consent card, for example, doesn't have a text; instead, the value of the clicked button is sent in the activity.value property.

{
  "activity": {
    "attachments": [],
    "channelData": {
      "clientActivityID": "9dfcaq9stpc",
      "postBack": true,
    },
    "channelId": "webchat",
    "from": {
      "id": "r_nhl5eooup9",
      "name": "",
      "role": "user"
    },
    "localTimestamp": "2025-08-01T16:42:33.718-03:00",
    "localTimezone": "America/Buenos_Aires",
    "locale": "en",
    "text": undefined,
    "type": "message",
    "value": {
       "action": "Allow"
     }
  },
}

Detailed Changes

  • Created a new sendActivity function to post the activity to the Copilot Studio API.
  • Updated askQuestionAsync function to call the new sendActivity method after creating the activity with the question's text.
  • Replaced the call to askQuestionAsync with sendActivity in copilotStudioWebChat allowing activities with no text, like the one used in Office 365 consent cards.

Testing

This image shows the WebChat sample working with Manual Authentication. After pressing the "Allow" button, the Office 365 resource was successfully accessed, and an email was sent by the agent.
image

ceciliaavila and others added 3 commits August 4, 2025 11:59
Co-authored-by: Joel Mut <62260472+sw-joelmut@users.noreply.github.com>
Copy link
Copy Markdown
Member

@rido-min rido-min left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rido-min rido-min merged commit e9c40d1 into main Aug 11, 2025
7 checks passed
@rido-min rido-min deleted the southworks/fix/csc-webchat-allow-card branch August 11, 2025 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Manual Authentication failing on test-agents/copilotstudio-webchat Consent of Office 365 User is not working from test-agents/copilotstudio-webchat

2 participants