How can I re-read claims? #55360
Unanswered
DavidThielen
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is there any way to force the
AuthenticationState
to re-read the database when claims have changed?I've implemented a
ServerAuthenticationStateProvider
and it works great for my adding IdentityUser.Enabled. But when I set it to re-read the claims on a call toExAuthenticationStateProvider.GetAuthenticationStateAsync()
, while that does return an updated list of the claims, that list is not propagated to theAuthenticationState
.Is there a way to propagate it other than having the user log out and back in?
I have the relevant code below. The problem is, when I call
NotifyAuthenticationStateChanged()
from when I callUpdateState()
in my blazor page it throws:InvalidOperationException - Collection was modified; enumeration operation may not execute.
With a call stack of:
Any idea how to work around this? I think that the notification needs to be called to update the cascading value. But it doesn't like it being updated here.
??? - thanks - dave
In
Main()
Routes.razor:
ExAuthenticationStateProvider.cs
Beta Was this translation helpful? Give feedback.
All reactions