question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Blazor WASM and IdentityServer4 - AuthenticationState out of sync when using multiple tab pages in chromium

See original GitHub issue

Defect 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:open
  • Created 3 years ago
  • Reactions:1
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
javiercncommented, Aug 18, 2020

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.

0reactions
msftbot[bot]commented, Dec 30, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found