MSAL issue with Copilot Studio SDK
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 55/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Ruhig
- Tech-Stack
- react, typescript
- Bereich
- authentication, frontend
Rechercherichtung
Beginnen Sie damit, die MSAL-Initialisierung und die loginPopup-Aufrufe im webpart zu lokalisieren, und untersuchen Sie anschließend, wie sich das React-Rendering auf die MSAL-Instanz auswirkt. Überprüfen Sie, dass dieselbe Instanz wiederverwendet wird und handleRedirectPromise() aufgerufen wird. Als abgeschlossen gilt die Aufgabe, wenn die Authentifizierung das Token an das webpart zurückgibt und das weitergeleitete SharePoint-Popup automatisch geschlossen wird.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 807
- Forks
- 493
- Ø Merge
- 17 Std. 8 Min.
- Gemergte PRs (30 T.)
- 3
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus microsoft/CopilotStudioSamples
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
microsoft/CopilotStudioSamples#534 · 1 Kommentar ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 30/100
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 42/100
-
Issue: SharePoint SSO ComponentEvtl. wieder frei @adilei hat das vor 65 Tagen übernommen, und es ist kein Pull Request offen. OffenSharePointSSOComponent
microsoft/CopilotStudioSamples#537 · 1 zugewiesene Person ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 45/100
microsoft/CopilotStudioSamples#532 · 1 Kommentar ·
Alle Issues in microsoft/CopilotStudioSamples
Ähnliche Issues
-
area: web bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
kinqsradio/orbyn-engineering#227 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
joeldesante/TurfBuilder#258 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
ncecere/open-mcp-portal#85 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 63/100
loathers/garbage-collector#2865 ·
Maintainer antworten meist innerhalb von 1 Tag
-
test-reliability
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Azure/azure-sdk-for-js#40672 · 1 Reaktion ·
Maintainer antworten meist innerhalb von 1 Tag