acquireTokenPopup flow suggested behavior #5314
Labels
answered
Question has received "first qualified response"
documentation
Related to documentation.
feature-unconfirmed
msal-browser
Related to msal-browser package
Needs: Attention 👋
Awaiting response from the MSAL.js team
public-client
Issues regarding PublicClientApplications
question
Customer is asking for a clarification, use case or information.
tracked-internally
Bugs that are tracked by Msft internally
Core Library
MSAL.js v2 (@azure/msal-browser)
Wrapper Library
Not Applicable
Public or Confidential Client?
Public
Description
When using the recommended flow stated in the documentation for token acquisition, there's a two-step approach calling
acquireTokenSilent
and thenacquireTokenPopup
ifInteractionRequiredAuthError
is thrown.My main problem involves acquireTokenPopup not handling multiple requests
My suggestions would be as follows:
acquireTokenPopup should internally store the initial promise for the popup and return that for all subsequent requests, till the initial promise has been resolved
My reasoning is as follows:
Since this code path is used for token acquisition and UI's tend to make multiple API requests at the same time, it's reasonable to assume this is not an edge case and should operate similarly to how
acquireTokenSilent
handles multiple requests.This is how our acquireToken function looks with a workaround:
Thanks!
Source
External (Customer)
The text was updated successfully, but these errors were encountered: