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

AADTokenProvider fails to get token in new Lists UI

Open vladigubler opened this issue 2 years ago • 1 comments

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
  • [X] 💥 Google Chrome
  • [ ] 💥 FireFox
  • [ ] 💥 Safari
  • [ ] mobile (iOS/iPadOS)
  • [ ] mobile (Android)
  • [ ] not applicable
  • [ ] other (enter in the "Additional environment details" area below)

Additional environment details

  • browser version
  • SPFx version
  • Node.js version
  • etc

Describe the bug / error

SPFX extension adds a command bar button to the list. In the new list view experience (MS Lists), the buttons show up in Edge/Chrome and execute. But when attempting to retrieve access tokens from AADTokenProvider in the button click event handler, it stops at some point with the MS scripts and doesn't actually returns anything. Buttons that do not use AADTokenProvider work normally.

BTW, the buttons do not load in FireFox at all.

Steps to reproduce

  1. Create an SPFx extension that adds command bar buttons to the list. Register API Access for some resource and approve.
  2. In the button click event use AADTokenProvider to retrieve an access token
  3. While in the new MS Lists interface, debug the code in F12 when executing and see that it never returns an access token while triggering no error.
  4. Compare to how the code executes in regular modern list view, where it successfully returns an access token.

Expected behavior

AADTokenProvider will return a valid access token as requested.

vladigubler avatar Aug 23 '24 13:08 vladigubler

Seems to be ok now!

vladigubler avatar Sep 04 '24 21:09 vladigubler