Back to Aspnetcore

Authentication Component

aspnetcore/blazor/security/includes/authentication-component.md

latest1.1 KB
Original Source

The page produced by the Authentication component (Pages/Authentication.razor) defines the routes required for handling different authentication stages.

The xref:Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticatorView component:

razor
@page "/authentication/{action}"
@using Microsoft.AspNetCore.Components.WebAssembly.Authentication

<RemoteAuthenticatorView Action="@Action" />

@code {
    [Parameter]
    public string? Action { get; set; }
}

[!NOTE] Nullable reference types (NRTs) and .NET compiler null-state static analysis is supported in ASP.NET Core in .NET 6 or later. Prior to the release of ASP.NET Core in .NET 6, the string type appears without the null type designation (?).