Blazor application is logged in then logs itself out

  Kiến thức lập trình

I’ve got a Blazor application with authentication against IdentityServer.

After logging in I go to this page:

@page "/LoggedIn"
@attribute [Authorize]
    @foreach( Claim c in HttpContext.User.Claims)
        <li><code>@c.Type</code>: <code>@c.Value</code></li>

<h2>Here is the counter</h2>


<h2>Here is the auth</h2>


@code {
    private HttpContext HttpContext { get; set; } = default!;

When the page loads both the server side (top) section and the client side (bottom) section show the list of claims.

Then, after a few second, the bottom section disappears — presumably becuse the client side code thinks that the user isn’t authenticated.

What is causing this?

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website