Hi all;
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 to ExAuthenticationStateProvider.GetAuthenticationStateAsync()
, while that does return and updated list of the claims, that list is not propagated to the AuthenticationState
.
Is there a way to propigate it other than having the user log out and back in?
My Routes.razor is:
<Router AppAssembly="typeof(Program).Assembly">
<Found Context="routeData">
<AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)">
<NotAuthorized>
<div class="message--401">
<h1 role="alert">Sorry, you're not authorized to view this page.</h1>
<p>You must have an Admin claim and be set to use 2FA when logging in.</p>
</div>
</NotAuthorized>
</AuthorizeRouteView>
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
</Found>
<NotFound>
<PageTitle>Not found</PageTitle>
<LayoutView Layout="@typeof(MainLayout)">
<div class="message--404">
<h1 role="alert">Sorry, there's nothing at this address.</h1>
</div>
</LayoutView>
</NotFound>
thanks - dave