Making multiple calls to acquireTokenSilent, may result in multiple requests to service POST /token, is there a way to use whichever request succeeded?
See original GitHub issueLibrary
-
msal@1.x.x
or@azure/msal@1.x.x
-
@azure/msal-browser@2.6.1
-
@azure/msal-node@1.x.x
-
@azure/msal-react@1.x.x
-
@azure/msal-angular@0.x.x
-
@azure/msal-angular@1.x.x
-
@azure/msal-angular@2.x.x
-
@azure/msal-angularjs@1.x.x
Description
Currently in our app, we make a call to acquireTokenSilent
before any api request. We can make api requests in parallel which result in parallel calls to acquireTokenSilent
.
When needed, acquireTokenSilent
will make network calls to POST /token to get a new token. Currently this results in multiple calls to POST /token.
In some of our logs, we see that one or two of them will fail with status code 0: Failed to fetch.
- I’m not sure why status code 0 is happening for some requests, but other requests succeed
- In the same batch of parallel requests to POST /token, if only 1 fails, does the library return the result of any previously successful request?
- For example say request A and request B both start at the same time. Request A succeeds first, and then request B fails. Can the
acquireTokenSilent
method return the result of request A for both calls?
Source
- Internal (Microsoft)
- Customer request
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (4 by maintainers)
Top Results From Across the Web
Single-page application: Acquire a token to call an API
The pattern for acquiring tokens for APIs with MSAL.js is to first attempt a silent token request by using the acquireTokenSilent method.
Read more >Getting null everytime when AcquireTokenSilent in ASP.NET ...
My project is .ASP.Net 4.8. In order to fix the issue, I did not update the code, my code remain as is. I...
Read more >angular msal refresh token | The AI Search Engine You Control
You could use acquireTokenSilent method to automatically refresh token for you in MSAL.NET. MSAL uses a cache to store tokens based on specific...
Read more >Silent Refresh - Refreshing Access Tokens when using the ...
This also applies to any flow on a public client incapable of keeping a secret or making secure back channel requests. If a...
Read more >Modern Authentication with Azure Active Directory for Web ...
Azure AD is a public cloud service, application developers can also take ... businesses, including the many that are already using Azure AD,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I am very excited to hear this will be implemented. Hopefully soon!
@thoo1 That’s a reasonable request and we will look into it.