Table of Contents

Create the Server-side Application

This step covers the host and client application shape used by the recommended SessionAuth and server-side proxy model.

Create the server-side application shape before configuring authentication, proxying, and database details.

Purpose

The recommended application model uses an ASP.NET Core host, a Blazor application, SessionAuth, and server-side proxying as one integrated application.

This setup is the preferred starting point for new RecroGrid Framework applications because it keeps authentication and downstream API access under central server control.

Project shape

Use a server-hosted application structure where the ASP.NET Core host owns the application origin.

At minimum, the solution should provide:

  • an ASP.NET Core host application;
  • a Blazor application rendered from that host;
  • the RecroGrid Framework client packages needed by the interactive UI;
  • the host-side OpenID Connect and proxy integration.

Package selection

Use these packages according to their responsibilities:

  • Recrovit.RecroGridFramework.Client.Blazor.Host.OpenIdConnect on the server-side host;
  • Recrovit.RecroGridFramework.Client.Blazor.UI for the higher-level Blazor UI integration;
  • Recrovit.RecroGridFramework.Client.Blazor.SessionAuth for the SessionAuth-aware client behavior.

The host package is the recommended app-level entry point for this application model because it brings in the server-side OpenID Connect infrastructure, the SessionAuth SSR registration, and the downstream proxy wiring used by RecroGrid Framework applications.

Host registration

In the host Program.cs, register the host package and the route infrastructure used by the shared application.

using Recrovit.AspNetCore.Components.Routing.Configuration;
using Recrovit.AspNetCore.Components.Routing.Models;
using Recrovit.RecroGridFramework.Client.Blazor;
using Recrovit.RecroGridFramework.Client.Blazor.Host.OpenIdConnect.Configuration;
using Recrovit.RecroGridFramework.Client.Blazor.UI;

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddRecrovitComponentRouting(options =>
{
    options.AddRouteAssembly(typeof(App).Assembly);
    options.AddRouteAssembly(typeof(BlazorApp.Client._Imports).Assembly);
    options.DefaultLayout = typeof(MainLayout);
    options.SetNotFoundPage(RecrovitRoutesKind.Host, typeof(BlazorApp.Client.Pages.NotFound));
});

builder.AddRgfBlazorServerProxyOpenIdConnectRazorComponents();
builder.AddRgfBlazorServerProxyOpenIdConnectHost();

Host startup

Map the host endpoints and initialize the RecroGrid Framework runtime before serving requests.

var app = builder.Build();

app.UseHttpsRedirection();

app.MapRgfBlazorServerProxyOpenIdConnectEndpoints("/not-found");

await app.Services.InitializeRgfBlazorServerAsync();
await app.Services.InitializeRgfUIAsync(loadResources: false);

app.MapRgfBlazorServerProxyOpenIdConnectComponents<App>(typeof(BlazorApp.Client._Imports).Assembly);

await app.RunAsync();

What to configure next

After the application shape exists, continue with:

  • the database connection and Entity Framework ownership;
  • SessionAuth client behavior;
  • the host-side OpenID Connect and downstream proxy configuration;
  • the interactive client routing and initialization.

Next step