Same problem here. "@azure/msal-browser": "^3.3.0"
Using this to setActiveAccount
await msalInstance
.handleRedirectPromise()
.then((response) => {
if (response) {
const currentAccounts = msalInstance.getAllAccounts()
if (currentAccounts.length > 1) { // Multiple account scenario
// Add account selection code here
} else if (currentAccounts.length === 1) {
msalInstance.setActiveAccount(currentAccounts[0])
}
}
}).catch((error) => {
// eslint-disable-next-line no-console
console.error('Auth Plugin MSAL error', error)
})
Then after refreshing the page I use
const msalInstance = await PublicClientApplication.createPublicClientApplication(msalConfig)
const account = msalInstance.getActiveAccount()
Get null account.
When I check the logs I see:
[Mon, 30 Oct 2023 16:25:01 GMT] : [] : @azure/msal-browser@3.3.0 : Info - Emitting event: msal:initializeStart oidc-callback:106:22
[Mon, 30 Oct 2023 16:25:01 GMT] : [] : @azure/msal-browser@3.3.0 : Info - Emitting event: msal:initializeEnd oidc-callback:106:22
[Mon, 30 Oct 2023 16:25:01 GMT] : [] : @azure/msal-common@14.2.0 : Info - CacheManager:getIdToken - No token found oidc-callback:106:22
account null oidc-callback:106:22
[Mon, 30 Oct 2023 16:25:01 GMT] : [] : @azure/msal-common@14.2.0 : Info - CacheManager:getIdToken - No token found
i.e. "No token found."
I've just sent the HAR file and the console log to @Alfredo Revilla - Upwork Top Talent | IAM SWE SWA