Nabs.Launchpad.Core.Portal 9.0.145

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Nabs.Launchpad.Core.Portal --version 9.0.145
                    
NuGet\Install-Package Nabs.Launchpad.Core.Portal -Version 9.0.145
                    
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="Nabs.Launchpad.Core.Portal" Version="9.0.145" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Nabs.Launchpad.Core.Portal" Version="9.0.145" />
                    
Directory.Packages.props
<PackageReference Include="Nabs.Launchpad.Core.Portal" />
                    
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 Nabs.Launchpad.Core.Portal --version 9.0.145
                    
#r "nuget: Nabs.Launchpad.Core.Portal, 9.0.145"
                    
#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 Nabs.Launchpad.Core.Portal@9.0.145
                    
#: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=Nabs.Launchpad.Core.Portal&version=9.0.145
                    
Install as a Cake Addin
#tool nuget:?package=Nabs.Launchpad.Core.Portal&version=9.0.145
                    
Install as a Cake Tool

Nabs Launchpad Core Portal Library

A comprehensive .NET 9 library for building Blazor Server portal applications with authentication, user context management, and service configuration.

Overview

The Nabs.Launchpad.Core.Portal library provides essential infrastructure for creating enterprise-grade Blazor Server portal applications. It includes JWT authentication, user context management, middleware pipeline configuration, and service registration helpers.

Features

  • Blazor Server Components: Pre-configured setup for interactive server-side Blazor applications
  • JWT Authentication: Complete JWT Bearer token authentication with configurable options
  • User Context Management: Automatic user context creation and injection from HTTP context
  • Middleware Pipeline: Built-in middleware for user context extraction and management
  • Localization Support: Multi-culture support with en-NZ, en-US, af, and mi locales
  • Service Defaults Integration: Seamless integration with Nabs.Launchpad.Core.ServiceDefaults
  • Portal Context: Configurable portal settings and base path support
  • MVVM Messaging: Integrated CommunityToolkit.Mvvm messaging support

Dependencies

This library depends on:

  • Nabs.Launchpad.Core.Context - User and portal context definitions
  • Nabs.Launchpad.Core.Interfaces - Core interfaces and contracts
  • Nabs.Launchpad.Core.ServiceDefaults - Default service configurations
  • Nabs.Launchpad.Ui.Shell - UI shell components and layouts
  • Microsoft.AspNetCore.Authentication.JwtBearer - JWT authentication support

Installation

dotnet add package Nabs.Launchpad.Core.Portal

Quick Start

1. Configure Portal Services

var builder = WebApplication.CreateBuilder(args);

builder.AddPortalServices(options =>
{
    options.PortalName = "My Portal";
    options.PortalContext = new PortalContext
    {
        PortalBasePath = "/myportal"
    };
    options.AdditionalAssemblies = [typeof(MyComponent).Assembly];
    options.DisableAuth = false; // Enable authentication
    options.AuthIssuer = "https://myauth.example.com";
    options.AuthAudience = "my-portal-audience";
    options.AuthKey = "your-secret-key-here";
});

2. Configure Portal Application

var app = builder.Build();

app.UsePortalServices<App>(); // App is your root Blazor component

app.Run();

Configuration Options

PortalServiceOptions

Property Type Description Default
PortalName string Display name for the portal ""
PortalContext PortalContext Portal configuration settings new()
AdditionalAssemblies Assembly[] Additional assemblies for Blazor components []
DisableAuth bool Disable authentication completely false
AuthIssuer string JWT token issuer "AuthIssuer"
AuthAudience string JWT token audience "AuthAudience"
AuthKey string JWT signing key Default secure key

User Context

The library automatically creates and manages user context from authenticated HTTP requests:

public class MyComponent : ComponentBase
{
    [Inject] public UserContext UserContext { get; set; } = default!;
    
    protected override void OnInitialized()
    {
        if (UserContext.IsAuthenticated)
        {
            var userName = UserContext.DisplayName;
            var email = UserContext.Email;
            var objectId = UserContext.ObjectId;
        }
    }
}

Middleware Pipeline

The library configures the following middleware pipeline:

  1. HTTPS Redirection
  2. Exception Handling (non-development)
  3. Authentication & Authorization (if enabled)
  4. User Context Middleware
  5. Static Files & Assets
  6. Antiforgery
  7. Request Localization
  8. Blazor Hub & Components

Localization

Built-in support for multiple cultures:

  • en-NZ (default)
  • en-US
  • af (Afrikaans)
  • mi (M?ori)

Path Base Support

Configure custom base paths for portal deployment:

options.PortalContext = new PortalContext
{
    PortalBasePath = "/admin" // Portal accessible at /admin
};

Authentication Claims

The library extracts the following claims from JWT tokens:

  • name - Display name
  • email / preferred_username - Email address
  • oid - Object identifier

Development vs Production

  • Development: Detailed errors enabled, exception page used
  • Production: Generic error page, HSTS enabled

Examples

Minimal Portal Setup

var builder = WebApplication.CreateBuilder(args);

builder.AddPortalServices(options =>
{
    options.PortalName = "Simple Portal";
    options.DisableAuth = true; // For development
});

var app = builder.Build();
app.UsePortalServices<App>();
app.Run();

Enterprise Portal with Authentication

var builder = WebApplication.CreateBuilder(args);

builder.AddPortalServices(options =>
{
    options.PortalName = "Enterprise Portal";
    options.PortalContext = new PortalContext
    {
        PortalBasePath = "/enterprise"
    };
    options.AuthIssuer = builder.Configuration["Auth:Issuer"];
    options.AuthAudience = builder.Configuration["Auth:Audience"];
    options.AuthKey = builder.Configuration["Auth:SigningKey"];
    options.AdditionalAssemblies = [
        typeof(EnterpriseComponents.Dashboard).Assembly,
        typeof(ReportingComponents.Reports).Assembly
    ];
});

var app = builder.Build();
app.UsePortalServices<App>();
app.Run();

Contributing

This library is part of the Nabs Launchpad framework. For contributing guidelines, please refer to the main repository documentation.

License

Copyright � Net Advantage Business Solutions. All rights reserved.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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
9.0.146 71 8/15/2025
9.0.145 125 8/11/2025
9.0.144 128 8/8/2025
9.0.137 98 7/29/2025
9.0.136 95 7/29/2025
9.0.135 98 7/28/2025
9.0.134 143 7/9/2025
9.0.133 139 7/9/2025
9.0.132 138 7/9/2025
9.0.131 149 7/9/2025
9.0.130 144 7/7/2025