![]() |
VOOZH | about |
dotnet add package Rystem.Api.Client.Authentication.BlazorServer --version 10.0.8
NuGet\Install-Package Rystem.Api.Client.Authentication.BlazorServer -Version 10.0.8
<PackageReference Include="Rystem.Api.Client.Authentication.BlazorServer" Version="10.0.8" />
<PackageVersion Include="Rystem.Api.Client.Authentication.BlazorServer" Version="10.0.8" />Directory.Packages.props
<PackageReference Include="Rystem.Api.Client.Authentication.BlazorServer" />Project file
paket add Rystem.Api.Client.Authentication.BlazorServer --version 10.0.8
#r "nuget: Rystem.Api.Client.Authentication.BlazorServer, 10.0.8"
#:package Rystem.Api.Client.Authentication.BlazorServer@10.0.8
#addin nuget:?package=Rystem.Api.Client.Authentication.BlazorServer&version=10.0.8Install as a Cake Addin
#tool nuget:?package=Rystem.Api.Client.Authentication.BlazorServer&version=10.0.8Install as a Cake Tool
Rystem.Api.Client.Authentication.BlazorServer adds token-based request enhancers for Rystem.Api.Client in Blazor Server applications.
It does not register generated API clients for you and it does not configure ASP.NET Core authentication middleware for you. Its job is narrower: attach authorization headers to the HTTP requests created by Rystem.Api.Client.
dotnet add package Rystem.Api.Client.Authentication.BlazorServer
The package exposes four extension methods:
| Method | Scope | Token source |
|---|---|---|
AddAuthenticationForAllEndpoints(settings) |
all generated clients | Microsoft.Identity.Web |
AddAuthenticationForEndpoint<T>(settings) |
one generated client | Microsoft.Identity.Web |
AddSocialAuthenticationForAllEndpoints(settings) |
all generated clients | Rystem.Authentication.Social.Blazor |
AddSocialAuthenticationForEndpoint<T>(settings) |
one generated client | Rystem.Authentication.Social.Blazor |
AuthorizationSettings currently exposes only:
ScopesThis follows the sample client app in src/Api/Test/Rystem.Api.TestClient/Program.cs.
var scopes = new[] { builder.Configuration["AzureAd:Scopes"]! };
builder.Services
.AddAuthentication(OpenIdConnectDefaults.AuthenticationScheme)
.AddMicrosoftIdentityWebApp(builder.Configuration.GetSection("AzureAd"))
.EnableTokenAcquisitionToCallDownstreamApi(scopes)
.AddInMemoryTokenCaches();
builder.Services.AddControllersWithViews()
.AddMicrosoftIdentityUI();
builder.Services.AddMicrosoftIdentityConsentHandler();
builder.Services.AddBusiness();
builder.Services.AddClientsForAllEndpointsApi(http =>
{
http.ConfigurationHttpClientForApi(client =>
{
client.BaseAddress = new Uri("https://localhost:7117");
});
});
builder.Services.AddAuthenticationForAllEndpoints(settings =>
{
settings.Scopes = scopes;
});
The AddAuthenticationForAllEndpoints(...) and AddAuthenticationForEndpoint<T>(...) methods:
AuthorizationSettingsTokenManager / TokenManager<T>)At request time, that enhancer calls:
IAuthorizationHeaderProvider.CreateAuthorizationHeaderForUserAsync(scopes)
and applies the returned Authorization header to the outgoing request.
For endpoint-specific registration, the generic TokenManager<T> uses the named settings key for that interface.
The social variants use SocialLoginManager from Rystem.Authentication.Social.Blazor and try to attach a bearer token fetched from the current social session.
If a social token cannot be fetched, the enhancer logs the user out and refreshes the navigation state.
You still need:
Rystem.Api.ClientAddClientsForAllEndpointsApi(...)Source-backed caveats:
settings callback for the social registration methods is currently not stored anywhere meaningfulSocialTokenManager currently builds the Authorization header from the wrapper result object instead of the fetched token stringSo the Microsoft Identity path is the better-documented and more reliable path today. Treat the social helpers as limited/experimental until they are cleaned up.
Rystem.Api.ClientIf you register both global enhancers and endpoint-specific enhancers, all-endpoint enhancers run first, then endpoint-specific enhancers.
src/Api/Test/Rystem.Api.TestClient/Program.cssrc/Api/Client/Rystem.Api.Client.Authentication.BlazorServer/DefaultInterceptor/ServiceCollectionExtensionsForAuthenticator.cssrc/Api/Client/Rystem.Api.Client.Authentication.BlazorServer/Authorization/TokenManager.cssrc/Api/Client/Rystem.Api.Client.Authentication.BlazorServer/Authorization/SocialTokenManager.csUse this package when you already have Blazor Server authentication in place and you want generated Rystem.Api.Client calls to carry bearer tokens automatically.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 10.0.8 | 5,495 | 5/13/2026 |
| 10.0.7 | 139 | 3/26/2026 |
| 10.0.6 | 433,561 | 3/3/2026 |
| 10.0.5 | 142 | 2/22/2026 |
| 10.0.4 | 140 | 2/9/2026 |
| 10.0.3 | 147,933 | 1/28/2026 |
| 10.0.1 | 209,118 | 11/12/2025 |
| 9.1.3 | 281 | 9/2/2025 |
| 9.1.2 | 764,526 | 5/29/2025 |
| 9.1.1 | 97,868 | 5/2/2025 |
| 9.0.32 | 186,729 | 4/15/2025 |
| 9.0.31 | 5,873 | 4/2/2025 |
| 9.0.30 | 88,832 | 3/26/2025 |
| 9.0.29 | 9,077 | 3/18/2025 |
| 9.0.28 | 284 | 3/17/2025 |
| 9.0.27 | 272 | 3/16/2025 |
| 9.0.26 | 286 | 3/13/2025 |
| 9.0.25 | 52,176 | 3/9/2025 |
| 9.0.20 | 19,642 | 3/6/2025 |
| 9.0.19 | 355 | 3/6/2025 |