aadTokenProviderFactory getToken() does not return anything or throw an error.
Target SharePoint environment
SharePoint Online
What SharePoint development model, framework, SDK or API is this about?
💥 SharePoint Framework
Developer environment
Windows
What browser(s) / client(s) have you tested
- [ ] 💥 Internet Explorer
- [X] 💥 Microsoft Edge
- [ ] 💥 Google Chrome
- [ ] 💥 FireFox
- [ ] 💥 Safari
- [ ] mobile (iOS/iPadOS)
- [ ] mobile (Android)
- [ ] not applicable
- [ ] other (enter in the "Additional environment details" area below)
Additional environment details
No response
Describe the bug / error
The code here used to work flawlessly, however for the past weeks I noticed that it keeps on stalling with no response or error message.
const provider = await this.context.aadTokenProviderFactory.getTokenProvider();
await provider.getToken("https://graph.microsoft.com")
Is there any way to fix this or did something change? I've wrapping it in a try catch but there is no error thrown.
Steps to reproduce
- Create a SPFX webpart with Graph Permissions specified in the package-solution.json
- Deploy app and approve the API permission from SP Admin
- Open the webpart
Expected behavior
Webpart should get the token
Hi @Circlet-ND - could you capture a network trace and send it to grahamc at microsoft.com? It would help me investigate the issue. On a test tenant I am not seeing that behavior so would like to figure out why you are seeing that. Thank you!
Update: I can replicate this issue more consistently if the page that hosts the webpart is loaded in an iFrame.
Hello @Circlet-ND, Thank you for bringing this issue to our attention. Could you please confirm if the issue still persists for you?
We are closing this issue for now. If the problem persists, feel free to reopen it or open a new one.