Hi @Jacques de Klerk ,
Thanks for reaching out.
The no_cached_authority_error
error happens if there isn't a cache entry for the authority for request. This can potentially happen if the temporary cache used by MSAL is cleared. In MSAL.js v2, all temporary cache values are stored in sessionStorage
(token storage is based on the cache.cacheLocation
setting). Can you please try debugging to figure out if there is a session storage entry for the authority value when this error is thrown?
As a mitigation, can you try setting storeAuthStateInCookie
to true
for all users.
While his piece of code will check the session storage for key and other temp values required for redirection process and if values exist and values are equal then it will through exception interaction_in_progress
Redirection in application can be handled by invoking handleRedirectPromise() method in MSAL. This ensures that the token response from the server is properly handled, and temporary cache entries are cleaned up. To resolve, verify all async/await wherever you call this on page load.
await msalInstance.handleRedirectPromise();
async signIn(){
// lines of code
Similar issue on SO - https://stackoverflow.com/questions/68726691/browserautherror-interaction-in-progress-unable-to-fix-regardles-of-solution
Hope this will help.
Thanks,
Shweta
Please remember to "Accept Answer" if answer helped you.