Rystem.Api.Client.Authentication.BlazorWasm 10.0.7

dotnet add package Rystem.Api.Client.Authentication.BlazorWasm --version 10.0.7
                    
NuGet\Install-Package Rystem.Api.Client.Authentication.BlazorWasm -Version 10.0.7
                    
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="Rystem.Api.Client.Authentication.BlazorWasm" Version="10.0.7" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Rystem.Api.Client.Authentication.BlazorWasm" Version="10.0.7" />
                    
Directory.Packages.props
<PackageReference Include="Rystem.Api.Client.Authentication.BlazorWasm" />
                    
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 Rystem.Api.Client.Authentication.BlazorWasm --version 10.0.7
                    
#r "nuget: Rystem.Api.Client.Authentication.BlazorWasm, 10.0.7"
                    
#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 Rystem.Api.Client.Authentication.BlazorWasm@10.0.7
                    
#: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=Rystem.Api.Client.Authentication.BlazorWasm&version=10.0.7
                    
Install as a Cake Addin
#tool nuget:?package=Rystem.Api.Client.Authentication.BlazorWasm&version=10.0.7
                    
Install as a Cake Tool

Rystem.Api.Client.Authentication.BlazorWasm

Rystem.Api.Client.Authentication.BlazorWasm adds bearer-token request enhancers for generated Rystem.Api.Client proxies in Blazor WebAssembly applications.

Like the Blazor Server package, it is an enhancer layer, not a full auth/client registration package.

Installation

dotnet add package Rystem.Api.Client.Authentication.BlazorWasm

What this package adds

The package exposes:

Method Scope
AddAuthenticationForAllEndpoints(settings) all generated clients
AddAuthenticationForEndpoint<T>(settings) one generated client

AuthorizationSettings currently exposes only:

  • Scopes

There are no social-auth variants in this package.

Typical Blazor WASM setup

var scopes = new[] { builder.Configuration["AzureAd:Scopes"]! };

builder.Services.AddMsalAuthentication(options =>
{
    builder.Configuration.Bind("AzureAd", options.ProviderOptions.Authentication);
    options.ProviderOptions.DefaultAccessTokenScopes.Add(scopes[0]);
});

builder.Services.AddBusiness();

builder.Services.AddClientsForAllEndpointsApi(http =>
{
    http.ConfigurationHttpClientForApi(client =>
    {
        client.BaseAddress = new Uri("https://api.myapp.io");
    });
});

builder.Services.AddAuthenticationForAllEndpoints(settings =>
{
    settings.Scopes = scopes;
});

Token flow

The package registers a request enhancer (TokenManager / TokenManager<T>) that:

  1. asks IAccessTokenProvider for an access token
  2. caches the last token in memory
  3. refreshes it when it is missing or within five minutes of expiry
  4. attaches it as Bearer <token> to the outgoing request

If Scopes is configured, token acquisition uses those scopes. Otherwise it requests the default token.

Important caveats

This package does not register clients

You still need:

  • Rystem.Api.Client
  • shared endpoint registrations
  • generated client registration with AddClientsForAllEndpointsApi(...) or AddClientForEndpointApi<T>(...)

Endpoint-specific settings are weaker than they look

The package exposes AddAuthenticationForEndpoint<T>(...), but the base token manager currently resolves AuthorizationSettings without using the named client key.

So per-endpoint auth settings are not as isolated as the API shape suggests.

Failed acquisition handling is rough

When token acquisition fails, the current implementation can produce an empty token string rather than a cleaner null-or-challenge flow.

So treat this package as a lightweight enhancer, not as a replacement for the richer AuthorizationMessageHandler patterns in custom Blazor WASM code.

No social helpers here

If you need the separate social-login helpers from this repo, they are not part of the WASM auth package.

Grounded by source files

  • src/Api/Client/Rystem.Api.Client.Authentication.BlazorWasm/DefaultInterceptor/ServiceCollectionExtensionsForAuthenticator.cs
  • src/Api/Client/Rystem.Api.Client.Authentication.BlazorWasm/Authorization/TokenManager.cs
  • src/Api/Test/Rystem.Api.Test.Domain/ServiceCollectionExtensions.cs

Use this package when you already have Blazor WebAssembly MSAL auth configured and you want generated Rystem.Api.Client calls to pick up bearer tokens automatically.

Product 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. 
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
10.0.7 45 3/26/2026
10.0.6 167,357 3/3/2026
10.0.5 101 2/22/2026
10.0.4 104 2/9/2026
10.0.3 147,907 1/28/2026
10.0.1 209,084 11/12/2025
9.1.3 233 9/2/2025
9.1.2 764,472 5/29/2025
9.1.1 97,790 5/2/2025
9.0.32 186,677 4/15/2025
9.0.31 5,791 4/2/2025
9.0.30 88,844 3/26/2025
9.0.29 9,011 3/18/2025
9.0.28 240 3/17/2025
9.0.27 239 3/16/2025
9.0.26 243 3/13/2025
9.0.25 52,118 3/9/2025
9.0.20 19,583 3/6/2025
9.0.19 293 3/6/2025
9.0.18 303 3/4/2025
Loading failed