Back to Aspnetcore

Blazor

aspnetcore/migration/80-to-90/includes/blazor.md

latest2.4 KB
Original Source

Adopt simplified authentication state serialization for Blazor Web Apps

Blazor Web Apps can optionally adopt simplified authentication state serialization.

In the server project:

The API only serializes the server-side name and role claims for access in the browser. To include all claims, set xref:Microsoft.AspNetCore.Components.WebAssembly.Server.AuthenticationStateSerializationOptions.SerializeAllClaims to true:

csharp
.AddAuthenticationStateSerialization(options => options.SerializeAllClaims = true);

In the client project (.Client):

For more information, see xref:aspnetcore-9#simplified-authentication-state-serialization-for-blazor-web-apps.

Streaming rendering attribute no longer requires the true parameter

In .NET 8, streaming rendering required you to pass true for the enabled parameter:

razor
@attribute [StreamRendering(true)]

In .NET 9 or later, true can optionally be removed, as true is now the default for the enabled parameter:

razor
@attribute [StreamRendering]