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

ADAL Invalid_state after getting access token while using API's in SPFX web part

Open michelsmit opened this issue 6 years ago • 4 comments

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

MicrosoftTeams-image (1)

src.zip

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.

michelsmit avatar Jun 23 '20 14:06 michelsmit

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

msft-github-bot avatar Jun 23 '20 14:06 msft-github-bot

Possible dupe of #4892? You say it returns nothing... sounds similar to a known issue...

andrewconnell avatar Jun 23 '20 18:06 andrewconnell

@andrewconnell seems the same issue, close this one?

michelsmit avatar Jun 30 '20 13:06 michelsmit

Closing this issue as a dupe. Please refer to our wiki for more details: Issue List Labels: status:duplicate

msft-github-bot avatar Jun 30 '20 13:06 msft-github-bot