microsoft / microsoft/CopilotStudioSamples

Issue with broken token endpoint link when calling Copilot Studio Agent from JavaScript

Open
#327 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
797
Forks
491
PR merge metrics
No merged PRs in 30d

Description

I am using the sample code (path: SSOSamples/SSOwithEntraID) to implement SSO login for a Copilot Studio agent, which is being called from an HTML page using MSAL in JavaScript . However, the API links for the token endpoint and conversation endpoint appear to be broken. Any help would be greatly appreciated.

These links were obtained from the AI agent's channel options in Copilot Studio. Here are the links: https://default{TenantId}.{Integer}.environment.api.powerplatform.com/copilotstudio/dataverse-backed/authenticated/bots/{cre...}/token?api-version=2022-03-01-preview

Please see the screenshot attached. Replace client id with Azure tenant ID. It shows result/response for conversation endpoint. I am getting same response for token endpoint.

Error Message: Invoke-WebRequest : The remote server returned an error: (404) Not Found. At line:1 char:1 + Invoke-WebRequest -UseBasicParsing -Uri "defaultexxxxxxx ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebExc eption + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

Image

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the SSOSamples/SSOwithEntraID sample and comparing its token and conversation endpoint usage with the links from Copilot Studio channel options. Reproduce the 404 response for both endpoints and verify the expected endpoint format and request parameters. Done means the sample reaches the token and conversation endpoints without a 404 response.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
api, authentication
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.