Blazor WASM and IdentityServer4 - AuthenticationState out of sync when using multiple tab pages in chromium
See original GitHub issueDefect description
We have the following defect when opening our blazor website in multiple chrome tab pages. That when you logout and login a different user in the second tab this isn’t notified in the first tab so the first tab displays the wrong logged-in user and that can make things confusing.
Repro scenario
- Start blazor wasm website with IdentityServer4 as authentication provider
- Open page in tab1 of chrome and login “User 1”
- Open page in tab2 of chrome and see that “User 1” is logged in and logout this user
- No notification in tab1 that user is logged out
AuthenticationStateProvider.AuthenticationStateChanged
is not triggered - Try to do something in tab1 gives “Not authorized” because no user logged in
What do I need to change in my configuration so a notification is send to the first tab page that the user was logged out / logged in in a different tabpage in chrome? If there is no out of the box solution for this I might add a custom SignalR event to send this notification.
In my current setup I user the default `builder.Services.AddApiAuthorization();’
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:8 (6 by maintainers)
Top Results From Across the Web
Blazor WASM standalone project reauthentication for ...
In the first tab I log out: I am re-directed to the login page, the stored token is gone, everything seems ok -...
Read more >How to Build and Secure Web Applications with Blazor
Learn how to build client-side Web apps using Blazor and how to secure them with Auth0 authentication and authorization features.
Read more >How to persist state across multiple browser tabs? : r/Blazor
P.S. The solution can be either blazor wasm or blazor server, ... The solution will work across tabs though I cannot say how...
Read more >How to Secure Blazor WebAssembly with IdentityServer4
In this article, we are going to learn how to secure Blazor WebAssembly with IdentityServer4 by using the OAuth2 and OIDC protocols.
Read more >Blazor Wasm Cookie Authentication
Secure a Blazor WebAssembly application with cookie authentication In most of ... and 'Asp. To scaffold out the page right click on your...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I happen to be working on the IdentityServer4 update, so I’ll give it a quick try to see if there is something easy we can do to enable this.
We’ve moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.