MSAL - handleRedirectPromise() returns null token or cache errors in JS.

Juan Francisco Sánchez 25 Reputation points
2023-03-29T11:14:18.99+00:00

Hi to all, I am Juan Francisco Sánchez a web app dev,

I am implementing AAD's user system. Now we have deployed it with the redirect option instead of popup. To handle the token returned after a sign in, we use the handleRedirectPromise() function as shown below.

User's image

Often when the promise is resolved the tokenResponse that returns is null, and other times throws the error "no_token_request_cache_error: No token request found in cache.", and sometimes it works well. I don't understand why this could happen so if anyone has any knowledge about this, i will truly appreciate his help.

Thanks to all of you.

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
22,528 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.