How to logout user from all tabs in blazor webassembly standalone with azureb2c

Nitesh 21 Reputation points
2024-05-18T12:20:37.97+00:00

Hi team, I have implemented azure b2c with my blazor webassembly standalone application. Now when user multiple tabs in same browser and log out from one of the session it remains active in other tabs. When user refreshes the page , it still is active. Is there a way I can make sure that user log out from all session when logout.

Microsoft Identity Manager
Microsoft Identity Manager
A family of Microsoft products that manage a user's digital identity using identity synchronization, certificate management, and user provisioning.
630 questions
Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
1,435 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 58,356 Reputation points
    2024-05-19T19:56:38.7766667+00:00

    I assume you are using bearer tokens. how are you storing the token? you can use local storage, and it will be shared among the tabs. using jsinterop you can get a message in each tab when the storage is updated. you can also use the browser broadcast api to send messages between tabs.

    https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API/Using_the_Web_Storage_API

    https://developer.mozilla.org/en-US/docs/Web/API/Broadcast_Channel_API

    0 comments No comments