Rystem.Api.Client.Authentication.BlazorServer
10.0.7
dotnet add package Rystem.Api.Client.Authentication.BlazorServer --version 10.0.7
NuGet\Install-Package Rystem.Api.Client.Authentication.BlazorServer -Version 10.0.7
<PackageReference Include="Rystem.Api.Client.Authentication.BlazorServer" Version="10.0.7" />
<PackageVersion Include="Rystem.Api.Client.Authentication.BlazorServer" Version="10.0.7" />
<PackageReference Include="Rystem.Api.Client.Authentication.BlazorServer" />
paket add Rystem.Api.Client.Authentication.BlazorServer --version 10.0.7
#r "nuget: Rystem.Api.Client.Authentication.BlazorServer, 10.0.7"
#:package Rystem.Api.Client.Authentication.BlazorServer@10.0.7
#addin nuget:?package=Rystem.Api.Client.Authentication.BlazorServer&version=10.0.7
#tool nuget:?package=Rystem.Api.Client.Authentication.BlazorServer&version=10.0.7
Rystem.Api.Client.Authentication.BlazorServer
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.
Installation
dotnet add package Rystem.Api.Client.Authentication.BlazorServer
What this package adds
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:
Scopes
Typical Blazor Server setup
This 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;
});
Microsoft Identity flow
The AddAuthenticationForAllEndpoints(...) and AddAuthenticationForEndpoint<T>(...) methods:
- create named
AuthorizationSettings - register them as singleton factory options
- add a request enhancer (
TokenManager/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.
Social flow
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.
Important caveats
This package is only an enhancer layer
You still need:
Rystem.Api.Client- endpoint/client registrations such as
AddClientsForAllEndpointsApi(...) - your own Blazor Server auth setup
The social path is rough in the current implementation
Source-backed caveats:
- the
settingscallback for the social registration methods is currently not stored anywhere meaningful SocialTokenManagercurrently builds theAuthorizationheader from the wrapper result object instead of the fetched token string
So 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.
Enhancer ordering still comes from Rystem.Api.Client
If you register both global enhancers and endpoint-specific enhancers, all-endpoint enhancers run first, then endpoint-specific enhancers.
Grounded by sample files
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.cs
Use 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 is compatible. 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. |
-
net10.0
- Microsoft.Identity.Web (>= 4.6.0)
- Rystem.Api.Client (>= 10.0.7)
- Rystem.Authentication.Social.Blazor (>= 10.0.7)
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 |
|---|---|---|
| 10.0.7 | 34 | 3/26/2026 |
| 10.0.6 | 148,180 | 3/3/2026 |
| 10.0.5 | 107 | 2/22/2026 |
| 10.0.4 | 110 | 2/9/2026 |
| 10.0.3 | 147,900 | 1/28/2026 |
| 10.0.1 | 209,084 | 11/12/2025 |
| 9.1.3 | 252 | 9/2/2025 |
| 9.1.2 | 764,499 | 5/29/2025 |
| 9.1.1 | 97,838 | 5/2/2025 |
| 9.0.32 | 186,702 | 4/15/2025 |
| 9.0.31 | 5,843 | 4/2/2025 |
| 9.0.30 | 88,806 | 3/26/2025 |
| 9.0.29 | 9,046 | 3/18/2025 |
| 9.0.28 | 256 | 3/17/2025 |
| 9.0.27 | 242 | 3/16/2025 |
| 9.0.26 | 262 | 3/13/2025 |
| 9.0.25 | 52,149 | 3/9/2025 |
| 9.0.20 | 19,614 | 3/6/2025 |
| 9.0.19 | 329 | 3/6/2025 |
| 9.0.18 | 314 | 3/4/2025 |