Share via


WebAssemblyRazorComponentsBuilderExtensions.AddAuthenticationStateSerialization Method

Definition

Serializes the AuthenticationState returned by the server-side AuthenticationStateProvider using PersistentComponentState for use by interactive WebAssembly components via a deserializing client-side AuthenticationStateProvider which can be added by calling AddAuthenticationStateDeserialization from the Microsoft.AspNetCore.Components.WebAssembly.Authentication package in the client project.

public static Microsoft.Extensions.DependencyInjection.IRazorComponentsBuilder AddAuthenticationStateSerialization (this Microsoft.Extensions.DependencyInjection.IRazorComponentsBuilder builder, Action<Microsoft.AspNetCore.Components.WebAssembly.Server.AuthenticationStateSerializationOptions>? configure = default);
static member AddAuthenticationStateSerialization : Microsoft.Extensions.DependencyInjection.IRazorComponentsBuilder * Action<Microsoft.AspNetCore.Components.WebAssembly.Server.AuthenticationStateSerializationOptions> -> Microsoft.Extensions.DependencyInjection.IRazorComponentsBuilder
<Extension()>
Public Function AddAuthenticationStateSerialization (builder As IRazorComponentsBuilder, Optional configure As Action(Of AuthenticationStateSerializationOptions) = Nothing) As IRazorComponentsBuilder

Parameters

configure
Action<AuthenticationStateSerializationOptions>

A callback to customize the serialization of the AuthenticationState.

Returns

An IRazorComponentsBuilder that can be used to further customize the configuration.

Applies to