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
<PackageReference Include="Nerdolando.Bff.Components" Version="1.0.6" />
<PackageVersion Include="Nerdolando.Bff.Components" Version="1.0.6" />
<PackageReference Include="Nerdolando.Bff.Components" />
paket add Nerdolando.Bff.Components --version 1.0.6
#r "nuget: Nerdolando.Bff.Components, 1.0.6"
#:package Nerdolando.Bff.Components@1.0.6
#addin nuget:?package=Nerdolando.Bff.Components&version=1.0.6
#tool nuget:?package=Nerdolando.Bff.Components&version=1.0.6
About
Nerdolando.Bff.Components
is a library that provides integration for Blazor application with Nerdolando.Bff.AspNetCore
library.
Usage
Install the NuGet package:
dotnet add package Nerdolando.Bff.Components
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 | Versions 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. |
-
net8.0
- Microsoft.AspNetCore.Components.Authorization (>= 8.0.19)
- Microsoft.AspNetCore.Components.Web (>= 8.0.19)
- Microsoft.AspNetCore.Components.WebAssembly (>= 8.0.19)
- Microsoft.Extensions.Http (>= 8.0.1)
- Nerdolando.Bff.Abstractions (>= 1.0.6)
-
net9.0
- Microsoft.AspNetCore.Components.Authorization (>= 9.0.8)
- Microsoft.AspNetCore.Components.Web (>= 9.0.8)
- Microsoft.AspNetCore.Components.WebAssembly (>= 9.0.8)
- Microsoft.Extensions.Http (>= 9.0.8)
- Nerdolando.Bff.Abstractions (>= 1.0.6)
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 |