MSAL issue with Copilot Studio SDK
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 55/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- react, typescript
- Ambito
- authentication, frontend
Direzione di ricerca
Inizia individuando l'inizializzazione di MSAL e le chiamate a loginPopup nel webpart, quindi esamina in che modo il rendering di React influisce sull'istanza MSAL. Verifica che venga riutilizzata una sola istanza e che venga chiamato handleRedirectPromise(). Il lavoro è completato quando l'autenticazione restituisce il token al webpart e il popup SharePoint reindirizzato si chiude automaticamente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Issue Description:
We developed a webpart to access copilot agent data. When configuring the webpart on a SharePoint site, it opens a popup for authentication. After authentication succeeds, the token is not being returned to the webpart.
Microsoft Support team findings below,
The Auth pop-up opening the Sharepoint site is a direct symptom of new MSAL instance created on every call combined with missing handleRedirectPromise().
Here's what's happening step by step:
- loginPopup() opens a popup to login.microsoftonline.com.
- User picks their account → Azure AD authenticates successfully
- Azure AD redirects the popup to the redirect Uri, which is settings. redirectUri || window.location.origin — i.e., the SharePoint site URL
- The popup now loads the full SharePoint site instead of closing
The popup should close automatically at this point. MSAL's popup flow works by having the parent window monitor the popup's URL via polling. When the popup redirects back to the same origin with the auth code in the URL hash, the parent MSAL instance reads the code, processes it, and closes the popup.
But because a new MSAL instance is created on every call and handleRedirectPromise() is never called:
• The MSAL instance that opened the popup may have been garbage collected (React re-render)
• The polling interval that monitors the popup URL is gone
• Nobody reads the auth code from the popup's URL
• Nobody closes the popup
• The popup just sits there showing the SharePoint site it was redirected to
So the SharePoint site loading in the popup is the redirect working correctly from Azure AD's side — but MSAL on the parent side failing to intercept and close it.
To fix this, the MSAL instance must be a singleton, and handleRedirectPromise() must be called.
- Lingua principale
- TypeScript
- Stelle
- 803
- Fork
- 493
- Merge medio
- 8g 20h
- PR unite (30g)
- 1
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di microsoft/CopilotStudioSamples
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
microsoft/CopilotStudioSamples#534 · 1 commento ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
-
Issue: SharePoint SSO ComponentForse di nuovo libera @adilei l’ha presa 35 giorni fa e non c’è nessuna pull request aperta. ApertaSharePointSSOComponent
microsoft/CopilotStudioSamples#537 · 1 assegnatario ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
microsoft/CopilotStudioSamples#532 · 1 commento ·
-
Unable to Deploy SPFx Agent to a Single SharePoint Site (Works Only with Tenant-Wide Deployment)Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
microsoft/CopilotStudioSamples#531 · 1 commento ·
Tutte le issue di microsoft/CopilotStudioSamples
Issue simili
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno
-
[Bug] remember() with special characters in namespace hangs until timeout instead of returning 400Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
MystenLabs/MemWal#1133 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug user-priority/P2
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 Meno di un'ora Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
Effect-TS/effect#8881 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno