Nerdolando.Bff.Components 1.0.6

dotnet add package Nerdolando.Bff.Components --version 1.0.6
                    
NuGet\Install-Package Nerdolando.Bff.Components -Version 1.0.6
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Nerdolando.Bff.Components" Version="1.0.6" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Nerdolando.Bff.Components" Version="1.0.6" />
                    
Directory.Packages.props
<PackageReference Include="Nerdolando.Bff.Components" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Nerdolando.Bff.Components --version 1.0.6
                    
#r "nuget: Nerdolando.Bff.Components, 1.0.6"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Nerdolando.Bff.Components@1.0.6
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Nerdolando.Bff.Components&version=1.0.6
                    
Install as a Cake Addin
#tool nuget:?package=Nerdolando.Bff.Components&version=1.0.6
                    
Install as a Cake Tool

About

Nerdolando.Bff.Components is a library that provides integration for Blazor application with Nerdolando.Bff.AspNetCore library.

Usage

  1. Install the NuGet package:

    dotnet add package Nerdolando.Bff.Components
    
  2. Configure your Blazor application to use BFF services in your Program.cs:

     builder.Services.AddCascadingAuthenticationState();
     builder.Services.AddAuthorizationCore();
    
     //add BFF services
     builder.Services.AddBffServices(o =>
     {
         o.BffBaseAddress = new Uri("https://localhost:7133"); //your BFF URL
         o.FrontAlias = "my-spa"; //the same alias you used in BFF configuration
     });
    
     //add client to call your API through BFF
     builder.Services.AddHttpClient("BffApi", c =>
     {
         c.BaseAddress = new Uri("https://localhost:7133"); //you must provide your BFF URL here, not Api URL. You define Api path in BFF configuration
     }).AddCredentialCookie(); //you must add this to send auth cookie to BFF
    
    

Components

You can use the following components in your Blazor application:

RedirectToLogin

This component redirects the user to the login page of the BFF when rendered. You can specify the ReturnUrl parameter to indicate where the user should be redirected after a successful login. Note that this component works as soon as it's rendered. Example usage:

@page "/authentication/login"
@using Nerdolando.Bff.Components.Components

<RedirectToLogin FrontAlias="my-spa" ReturnUrl="/signed-in" />

When you navigate to /authentication/login, the component will redirect you to the BFF login page. After a successful login, you will be redirected to /signed-in.

Services

IAuthenticationStateRefresher

This service allows you to refresh the authentication state of the user.

It has only one method: RefreshAsync(), which refreshes the authentication state.

ILogOutRequest

This service allows you to log out the user from the system (BFF and Identity Provider). It has only one method: LogoutAsync(string returnUrl = "/"), which logs out the user and redirects to the specified return URL.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.6 123 9/8/2025