Cirreum.Runtime.Wasm.Msal 1.0.37

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

Cirreum.Runtime.Wasm.Msal

NuGet Version NuGet Downloads GitHub Release License .NET

Seamless Azure Entra ID authentication for Blazor WebAssembly applications

Overview

Cirreum.Runtime.Wasm.Msal provides a fluent API for integrating Microsoft Authentication Library (MSAL) with Blazor WebAssembly applications in the Cirreum Framework. It simplifies Azure Entra ID authentication setup for both workforce (internal) and external identity (CIAM) scenarios, with optional Microsoft Graph integration for user profile enrichment.

Features

  • Workforce & External Identity - First-class support for Entra ID workforce tenants and Entra External ID (CIAM)
  • Dynamic Authentication - Runtime tenant resolution for multi-tenant SaaS applications
  • Microsoft Graph Integration - Profile enrichment with configurable depth (minimal, extended, or custom)
  • Fluent Builder API - Chainable configuration methods with IntelliSense support
  • Session Monitoring - Track user activity and API calls with configurable timeouts
  • Claims Extensibility - Custom claims transformations via IClaimsExtender
  • Authorization Policies - Pre-configured role-based policies with easy customization
  • WASM Optimized - Source-generated logging for minimal bundle size

Installation

dotnet add package Cirreum.Runtime.Wasm.Msal

Quick Start

Workforce Authentication

var builder = DomainApplication.CreateBuilder(args);

builder.AddEntraAuth(
    tenantId: "your-tenant-id",  // or "common" for multi-tenant
    clientId: "your-client-id"
);

await builder.BuildAndRunAsync<App>();

External Identity (CIAM)

builder.AddEntraExternalAuth(
    domain: "your-tenant",       // e.g., "contoso" for contoso.ciamlogin.com
    clientId: "your-client-id"
);

Microsoft Graph Integration

Minimal Enrichment

Basic user profile data with User.Read scope only:

builder.AddEntraAuth("tenant-id", "client-id")
    .AddGraphServices()
    .WithMinimalGraphEnrichment();

Extended Enrichment

Comprehensive profile including mailbox settings, organization, and directory memberships:

builder.AddEntraAuth("tenant-id", "client-id")
    .AddGraphServices()
    .WithExtendedGraphEnrichment();

External Tenant Enrichment

Optimized for Entra External ID with limited Graph API access:

builder.AddEntraExternalAuth("domain", "client-id")
    .AddGraphServices()
    .WithGraphEnrichment();

Custom Graph Scopes

builder.AddEntraAuth("tenant-id", "client-id")
    .AddGraphServices()
    .WithExtendedGraphEnrichment(graphScopes: [
        "User.Read",
        "MailboxSettings.Read",
        "Directory.Read.All"
    ]);

Advanced Configuration

Custom Authorization Policies

Default policies (Standard, StandardInternal, StandardAgent, StandardManager, StandardAdmin) are included automatically. Add custom policies:

builder.AddEntraAuth("tenant-id", "client-id", authorization: options =>
{
    options.AddPolicy("Engineering", policy =>
        policy.RequireClaim("department", "Engineering"));
});

Session Monitoring

builder.AddEntraAuth("tenant-id", "client-id")
    .AddSessionMonitoring(options =>
    {
        options.TrackApiCalls = true;
        options.IdleTimeout = TimeSpan.FromMinutes(30);
    });

Custom Claims Extender

builder.AddEntraAuth("tenant-id", "client-id")
    .AddClaimsExtender<MyClaimsExtender>();

Application User Integration

builder.AddEntraAuth("tenant-id", "client-id")
    .AddApplicationUserResolver<AppUserResolver>();

Dynamic Multi-Tenant Authentication

For SaaS applications where tenant configuration is resolved at runtime:

builder.AddDynamicAuth(
    configureWorkforce: auth => auth
        .AddGraphServices()
        .WithExtendedGraphEnrichment(),
    configureExternal: auth => auth
        .AddGraphServices()
        .WithGraphEnrichment()
);

Dynamic auth reads configuration from window.tenantAuthConfig, which is populated by the loader when auth-type="dynamic" and auth-type-url are set on the loader script. Custom scopes are specified in the tenant configuration endpoint response, not in code.

Custom OAuth Scopes

builder.AddEntraAuth(
    tenantId: "tenant-id",
    clientId: "client-id",
    defaultScopes: ["api://my-api/read", "api://my-api/write"]
);

Default OAuth Scopes

The following scopes are included by default:

  • openid
  • profile
  • email
  • offline_access
  • User.Read

Additional scopes passed via defaultScopes are merged with these defaults.

Architecture

Cirreum.Runtime.Wasm.Msal
├── HostingExtensions           # Entry points: AddEntraAuth, AddEntraExternalAuth, AddDynamicAuth
├── Authentication/
│   ├── Builders/               # Fluent builder implementations
│   ├── Enrichment/             # Graph profile enrichers (Minimal, Extended, External)
│   ├── Providers/              # GraphServiceClient provider
│   ├── EntraUserAccount        # User account with roles support
│   └── MsalClaimsPrincipalFactory
└── Extensions                  # Claims, Graph, Session configuration

Requirements

  • .NET 10.0+
  • Blazor WebAssembly
  • Azure Entra ID tenant (workforce or external)

Dependencies

  • Microsoft.Authentication.WebAssembly.Msal
  • Cirreum.Runtime.Wasm
  • Cirreum.Graph.Provider

License

MIT License - see LICENSE for details.


Cirreum Foundation Framework Layered simplicity for modern .NET

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
1.0.37 39 4/28/2026
1.0.36 81 4/27/2026
1.0.35 89 4/26/2026
1.0.34 86 4/26/2026
1.0.33 96 4/16/2026
1.0.32 107 4/15/2026
1.0.31 99 4/13/2026
1.0.30 96 4/13/2026
1.0.29 100 4/10/2026
1.0.28 106 3/25/2026
1.0.27 95 3/21/2026
1.0.26 97 3/20/2026
1.0.25 92 3/20/2026
1.0.24 94 3/20/2026
1.0.23 94 3/18/2026
1.0.22 103 3/17/2026
1.0.21 120 3/16/2026
1.0.20 113 3/16/2026
1.0.19 119 3/16/2026
1.0.18 113 3/16/2026
Loading failed