Ad

Search This Blog

Wednesday, December 28, 2022

ASP.NET Core Blazor authentication and authorization

MSDotnet Stack

ASP.NET Core Blazor authentication and authorization

  • The UI options presented to a user (for example, which menu entries are available to a user).
  • Access rules for areas of the app and components.
  • This article describes ASP.NET Core's support for the configuration and management of security in Blazor apps.
    This article describes ASP.NET Core's support for the configuration and management of security in Blazor apps.

    Authentication

    Blazor uses the existing ASP.NET Core authentication mechanisms to establish the user's identity. The exact mechanism depends on how the Blazor app is hosted, Blazor WebAssembly or Blazor Server.

    Blazor WebAssembly authentication

    Add the following: A package reference for Microsoft.AspNetCore.Components.Authorization.
    add The Microsoft.AspNetCore.Components.Authorization namespace to _Imports.razor file in the Blazor application
    To handle authentication, use of a built-in or custom AuthenticationStateProvider service is covered in the following sections.
    For more information on creating apps and configuration, see Secure ASP.NET Core Blazor WebAssembly
    All source collected from https://learn.microsoft.com/en-us/aspnet/core/blazor/security/?view=aspnetcore-6.0

    No comments:

    Post a Comment