I have a React Native project that we've recently been attempting to move over to AzureB2C. We have been leveraging the now archived package react-native-msal
. Our project also employs react-native-web
. The web functionality is working without issue, however, when working in the app natively, I am getting an issue when attempting to call the acquireTokenSilent
method, which fails with the error message:
No cached accounts found for the supplied homeAccountId and clientId
I've found this post which mentions an issue with the signing key, but, re-running that does not result in a different Signature, and so I don't believe it's that. I also found this thread which suggests an answer but doesn't provide it.
Our configuration is quite simple as well.
{
"auth": {
"clientId": "<CLIENT_ID>",
"redirectUri": "msauth://<PACKAGE>/<SIGNATURE_HASH>",
"authority": "https://<TENANT>.b2clogin.com/tfp/<TENANT>.onmicrosoft.com/B2C_1A_SIGNUP_SIGNIN",
"navigateToLoginRequestUrl": false,
"knownAuthorities": [
"https://<TENANT>.b2clogin.com/tfp/<TENANT>.onmicrosoft.com/B2C_1A_SIGNUP_SIGNIN",
"https://<TENANT>.b2clogin.com/tfp/<TENANT>.onmicrosoft.com/B2C_1A_PASSWORDRESET"
]
},
"cache": {
"cacheLocation": "sessionStorage",
"storeAuthStateInCookie": false
}
}
The Sign in, out, getting accounts all work fine in both Web and the Native App. It's just that acquireTokenSilent doesn't work correctly in the Native App.
Does anyone have any other suggestions?