sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

"Token Request Previously Failed" appears when viewing a SP page embedded in Teams with a custom webpart that utilizes the AadHttpClient, but ONLY when an OOB webpart that also requires graph is on the page.

Open parmira5 opened this issue 2 years ago • 3 comments

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

šŸ’„ SharePoint Framework

Developer environment

None

What browser(s) / client(s) have you tested

  • [ ] šŸ’„ Internet Explorer
  • [ ] šŸ’„ Microsoft Edge
  • [X] šŸ’„ Google Chrome
  • [ ] šŸ’„ FireFox
  • [x] šŸ’„ Safari
  • [ ] mobile (iOS/iPadOS)
  • [ ] mobile (Android)
  • [ ] not applicable
  • [ ] other (enter in the "Additional environment details" area below)

Additional environment details

  • SPFx version: 1.18.2

Describe the bug / error

Using the PnP Modern Search webpart as an example here, but this happens with any SPFx solution that uses AadHttpClient. When the webpart is on the page alone, it works as expected. Adding a OOTB webpart (like the Group Calendar) triggers the error.

On its own, works fine: image

Once the Group calendar is added, the error appears: image

It seems like Group Calendar is attempting to hit this endpoint for the SharePoint web extensibility enterprise app and failing: image

Which then causes any subsequent requests for a token on the page to short circuit. The custom webpart doesn't even make an attempt to fetch a token when this occurs. Removing the Calendar webpart causes things to work as expected.

Steps to reproduce

  1. Add the Group Calendar Webpart to a page.
  2. Add a custom webpart that is reliant on AadHttpClient to the page.
  3. View the page via teams as a personal app.

Expected behavior

The custom webpart works as expected regardless of whether or not any other webparts are on the page.

parmira5 avatar Aug 19 '24 17:08 parmira5

Hello @parmira5, Thank you for bringing this issue to our attention. We will look into it and get back to you shortly.

Ashlesha-MSFT avatar Jun 03 '25 12:06 Ashlesha-MSFT

@parmira5, In my case, the custom web part functioned as expected. Image If there are any specific configuration details or steps I may have overlooked, please let me know — I’d be glad to review and retest accordingly.

Ashlesha-MSFT avatar Jun 04 '25 05:06 Ashlesha-MSFT

We are closing this issue for now. If the problem persists, feel free to reopen it or open a new one.

Ashlesha-MSFT avatar Jul 03 '25 10:07 Ashlesha-MSFT