react-aad-msal library reuses previous user token after logout

840 Views Asked by At

We are using react-aad-msal to authenticate users with Azure AD via AD B2C. B2C is configured with custom policies, but nothing specific to logout. We are passing authority, domain_hint and login_hint in authenticationparameters which change dynamically based on what user enters in the application email prompt before they are redirected to B2C login. The initial login works fine, however after calling authProvider.logout() if different use tries to login and his external idp doesn't change, but login_hint does it still somehow holds on to the token of the previous user. I see it going to post logout redirect uri. Local storage is empty, authenticationState is Unauthenticated, but then out of the blue the token of the previous user appears in local storage. Setting prompt to 'login' doesn't help. Anyone had similar issues? Where is it getting the token from? Strangely enough it works correctly in FireFox, but not in Chrome. Also, after changing the user it sometimes randomly goes into endless loop with a message that login is already in process in the browser console.

0

There are 0 best solutions below