![]() |
VOOZH | about |
dotnet add package Recrovit.RecroGridFramework.Client.Blazor.SessionAuth --version 10.1.0
NuGet\Install-Package Recrovit.RecroGridFramework.Client.Blazor.SessionAuth -Version 10.1.0
<PackageReference Include="Recrovit.RecroGridFramework.Client.Blazor.SessionAuth" Version="10.1.0" />
<PackageVersion Include="Recrovit.RecroGridFramework.Client.Blazor.SessionAuth" Version="10.1.0" />Directory.Packages.props
<PackageReference Include="Recrovit.RecroGridFramework.Client.Blazor.SessionAuth" />Project file
paket add Recrovit.RecroGridFramework.Client.Blazor.SessionAuth --version 10.1.0
#r "nuget: Recrovit.RecroGridFramework.Client.Blazor.SessionAuth, 10.1.0"
#:package Recrovit.RecroGridFramework.Client.Blazor.SessionAuth@10.1.0
#addin nuget:?package=Recrovit.RecroGridFramework.Client.Blazor.SessionAuth&version=10.1.0Install as a Cake Addin
#tool nuget:?package=Recrovit.RecroGridFramework.Client.Blazor.SessionAuth&version=10.1.0Install as a Cake Tool
Recrovit.RecroGridFramework.Client.Blazor.SessionAuth adds session-based authentication support to RGF Blazor applications that talk to the API through host-backed authentication endpoints.
Use it together with Recrovit.RecroGridFramework.Client.Blazor.UI when:
The package extends the base Blazor client integration with session-auth specific behavior:
AuthenticationStateProvider decoration so an expired host session is reflected in Blazor auth stateThe package exposes two registration entry points:
AddRgfBlazorSessionAuthClientServices(...): for the interactive Blazor clientAddRgfBlazorSessionAuthSsrServices(...): low-level SSR registration used by host-side integrationsAddRgfBlazorSessionAuthClientServices(...) configures:
ServerProxy auth modeRgfAuthorizeRouteContentAuthorizationCoreAuthenticationStateProvider decoration for session-aware auth stateAddRgfBlazorSessionAuthSsrServices(...) configures:
ServerProxySsr auth modeReference at least:
Recrovit.RecroGridFramework.Client.Blazor.UIRecrovit.RecroGridFramework.Client.Blazor.SessionAuthIn the usual application setup, SessionAuth is added together with Recrovit.RecroGridFramework.Client.Blazor.UI, while the base Recrovit.RecroGridFramework.Client.Blazor package remains a transitive building block.
In the client Program.cs, register SessionAuth and the Recrovit component routing services:
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Recrovit.AspNetCore.Components.Routing.Configuration;
using Recrovit.RecroGridFramework.Client.Blazor;
using Recrovit.RecroGridFramework.Client.Blazor.SessionAuth;
using Recrovit.RecroGridFramework.Client.Blazor.UI;
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.Services.AddRgfBlazorSessionAuthClientServices(
builder.Configuration,
apiBaseAddressOverride: builder.HostEnvironment.BaseAddress);
builder.Services.AddRecrovitComponentRouting(options =>
{
options.AddRouteAssembly(typeof(Program).Assembly);
});
var host = builder.Build();
await host.Services.InitializeRgfBlazorAsync();
await host.Services.InitializeRgfUIAsync();
await host.RunAsync();
For a Blazor Web App client, apiBaseAddressOverride: builder.HostEnvironment.BaseAddress makes the browser call the local host/proxy instead of the external API directly.
Routes.razorThe client routes should be rendered through RecrovitRoutes so the SessionAuth route authorization wrapper can take effect:
@using Recrovit.AspNetCore.Components.Routing
@using Recrovit.AspNetCore.Components.Routing.Models
<RecrovitRoutes Kind="RecrovitRoutesKind.Client"
AppAssembly="typeof(_Imports).Assembly"
DefaultLayout="typeof(MainLayout)"
NotFoundPage="typeof(Pages.NotFound)" />
For the typical server-side setup, use Recrovit.RecroGridFramework.Client.Blazor.Host.OpenIdConnect and configure the host according to that package's documentation.
That package is the recommended app-level entry point for the SessionAuth server-side scenario, including the OpenID Connect host setup, proxy configuration, and underlying SessionAuth SSR registration.
SessionAuth can be used not only for the built-in authentication endpoints, but also for application-specific host APIs and named downstream proxy routes without exposing whether the caller runs in the browser or during SSR.
Two usage patterns are worth separating:
IHostApiInvoker: calls the current host application, for example /api/userinfoIDownstreamApiInvoker: calls a configured downstream proxy route such as /downstream/{apiName}/{**path}Use the host API path when the application exposes its own DTO-producing endpoint and the host is responsible for composing the downstream call and mapping the response.
Use the downstream invoker when the caller intentionally wants the raw downstream response from a named DownstreamApis entry.
Example:
using Recrovit.RecroGridFramework.Client.Blazor.Services;
public sealed class UserInfoApiClient(IHostApiInvoker hostApiInvoker)
{
public async Task<UserInfoDto?> GetAsync(CancellationToken cancellationToken = default)
{
return await hostApiInvoker.GetFromJsonAsync<UserInfoDto>("/api/userinfo", cancellationToken);
}
}
For a raw downstream proxy call:
using Recrovit.RecroGridFramework.Client.Blazor.Services;
using var response = await downstreamApiInvoker.GetAsync("UserInfoApi");
In SSR, SessionAuth forwards the incoming authentication cookie for these local host-backed requests so the same calling code can be used during prerendering and in the interactive client.
When the interactive client starts, the package probes the host session endpoint.
When the user navigates to a protected route:
returnUrlPublic routes continue to render without login redirection even after session invalidation.
Recrovit.RecroGridFramework.Client.Blazor.UI: higher-level Blazor UI package that is typically registered together with SessionAuthRecrovit.RecroGridFramework.Client.Blazor.Host.OpenIdConnect: typical server-side host integration that brings in the SessionAuth SSR infrastructureRecrovit.RecroGridFramework.Client.Blazor: core RGF Blazor integrationRecrovit.RecroGridFramework.Client: base client runtime and HTTP services| 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. |
Showing the top 1 NuGet packages that depend on Recrovit.RecroGridFramework.Client.Blazor.SessionAuth:
| Package | Downloads |
|---|---|
|
Recrovit.RecroGridFramework.Client.Blazor.Host.OpenIdConnect
RecroGrid Framework ASP.NET Core host helpers for SSR server-proxy and OpenID Connect. |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 10.1.0 | 121 | 4/24/2026 |