ADAL Invalid_state after getting access token while using API's in SPFX web part
Category
- [x] Bug
Describe the bug
We have developed several SPFX web parts which make use of external API's (e.g. Graph, PowerBI and Windows Virtual Desktop). To obtain an access token we're using the aadTokenProviderFactory's provider getToken method. Most of the time this works, but once in a while getToken returns nothing, and all other web parts are not returning any data.
When inpecting the sessionStorage there are some adal entries, one of them contains the following error:
Invalid_state. state: 28742357-17ed-4ec3-9ccc-32b7f6c22aba|https://analysis.windows.net/powerbi/api

Furthermore, NO errors or other messagers appear in the console, and also no network traffic occurs once it seems broken.
Steps to reproduce
See attached web part code. Place it on a page and refresh the page until pressing one of the buttons in the web part don't deliver any result.
Expected behavior
Obtaining an access token without problems ;)
Environment details (development & target environment)
- Your Developer Environment: Windows 10
- Target Environment: SharePoint Online]
- Framework: SPFX
- Browser(s): Chromium Edge
- Tooling: SPFx v1.10.0
- Additional details: The more context you can provide, the easier it is (and therefore quicker) to help.
Additional context
Thanks for your contribution! Sharing is caring.
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.
Possible dupe of #4892? You say it returns nothing... sounds similar to a known issue...
@andrewconnell seems the same issue, close this one?
Closing this issue as a dupe. Please refer to our wiki for more details: Issue List Labels: status:duplicate