How to solve CacheManager:getIdToken - No token found error?

Devesh 40 Reputation points

I am using MSAL in React App. After the sign-in, I am getting the details using this code-

const [userDetails, setUserDetails] = useState(null); 
useEffect(() => {
      .then(() => {
        const currentUser = instance.getAllAccounts()[0];
      .catch((error) => console.log(error));
  }, []);

In the first load, I am getting these details in the const userDetails-

    "homeAccountId": "XX-X553252fedd35",
    "environment": "",
    "tenantId": "XX-63c7-XX-91c6-553252fedd35",
    "username": "",
    "localAccountId": "XX-7e21-4730-XX-XX",
    "name": "XX XX",
    "idToken": "xcasdcasdf3adsfa4sdafsd43fadsf43asdfxx"
    "idTokenClaims": {

First load- Screenshot

But when I reload the page, the IdToken got missing from this userDetails const.

And in the console, I got this log message after reloading-

@azure/msal-common@12.0.0 : Info - CacheManager:getIdToken - No token found

After reload- Screenshot

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

2 answers

Sort by: Most helpful
  1. 2023-10-30T22:17:33.4833333+00:00

    Hello @Devesh and everybody. Apologies for the inconvenience, msal-browser@3.3.0 prevents token look-ups for tenanted authorities. Downgrading to msal-browser@3.2.0 will solve the issue while the fix gets rolled out, potentially this week.

    10/31 Update: msal-browser@3.4.0 has been released and fixes the discussed issue.

    Let us know if you need additional assistance. If the answer was helpful, please accept it and rate it so that others facing a similar issue can easily find a solution.

    3 people found this answer helpful.

  2. Arun Manohar Manoharan 1 Reputation point

    It seems as an issue with the latest version of the app. Try using this: