Solvedmicrosoft authentication library for js acquireTokensilent return null accessToken randomly.
43 Answers
Share
Original✔️Accepted Answer
@mmuarc What I did was:
- Clone the project
- Switch to the branch
- Run
npm install
andnpm run build
in the/lib/msal-core
folder - In my project where I use msal, run
npm uninstall msal
to remove the npm hosted package - Run
npm install file:<path_to_msal-core_folder>
to install the package locally
Though this may be different than what others may do, this is what enabled me to test the new version.
Don't forget to remove the reference to the local package by running npm uninstall msal
and then npm install msal
again when you are done testing.
Hope this was helpful to you.
Other Answers:
Related Issues:
28
microsoft authentication library for js Invalid Issuer (iss: sts.windows.net) when acquiring token
I believe this is a configuration issue in the Azure AD App Registration I'm submitting a.. ...
15
microsoft authentication library for js B2C Token endpoint CORS
We appreciate everyone's patience I certainly understand the frustration Please follow the issue tem...
12
microsoft authentication library for js Getting A silent sign-in request was sent but no user is signed in in multiple app sign-in environment
@jmckennon . Might not be related to this but after this issue is been closed Please follow the issu...
9
microsoft authentication library for js Sample Code for Angular 8 (msal-angular)
@stevenruizhang @jaleleddineagrebi @Choran66 There is a new beta for MSAL Angular with rxjs 6 suppor...
7
microsoft authentication library for js Preventing 3rd Party Cookies block when using MSAL Angular (1.x)
@jo-arroyo Thanks for getting back to me This is a big issue for us Looking at the MSAL.js 2.0 sampl...
5
microsoft authentication library for js acquireTokensilent return null accessToken randomly.
@mmuarc What I did was: Clone the project Switch to the branch Run npm install and npm run build in ...
4
microsoft authentication library for js User cannot log out
For anyone who is stumped on this and finds this thread I found a solution I'm submitting a.. ...
I'm submitting a...
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ x] Other... Please describe:
Technical doubt and possibly a bug.
Browser:
Library version
<
Library version: 1.0.0
Current behavior
accessToken from acquireTokenSilent is null sometimes
Expected behavior
accessToken from acquireTokenSilent is never null. Any error should come in the error function.
Minimal reproduction of the problem with instructions
I have an apihelper that every time is going to do a call contacts my clientApplication wrapper like this:
The implementation of Ab2c.getTokenAsync is this:
So, basically I'm relying in clientApplication to handle the cached token for me since I understood that's what I'm supposed to do when using msal. But sometimes when I hit F5 in my page I get a valid loginResponse with a null accessToken.
When I refresh I do like 4 or 5 different requests which means 4 or 5 different calls to acquiretokensilent. What I see is that sometimes all of them work and sometimes the first actually works and returns a token but the following return a null value, most of the times all of them work...
Log example.
valid token null token valid token valid token valid token valid token
I think it might be related to refreshing while some request is still pending but I can't prove it.
Any ideas?
Miguel