Zwedze.Aetherweave.Security.Oidc 0.2.5

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

Aetherweave.Security.Oidc

Configuration-driven OIDC authentication for Blazor WebAssembly clients, with authorized HttpClient registration built on top of Zwedze.Aetherweave.Http.

Features

  • One-Line Registration - Configure AddOidcAuthentication from appsettings.json instead of hand-wiring ProviderOptions
  • Startup Validation - Missing or invalid configuration throws immediately via Zwedze.Aetherweave.Core
  • Authorized HTTP Clients - Register Aetherweave typed HttpClients that automatically attach the OIDC access token
  • Type-Safe Options - AetherweaveOidcOptions validated via data annotations

Installation

dotnet add package Zwedze.Aetherweave.Security.Oidc

Configuration (Aetherweave:Security:Oidc)

Key Notes
Authority Required. The identity provider's URL
ClientId Required. The registered client identifier
ResponseType Required. OIDC response type, e.g. code
DefaultScopes Required. Scopes requested on every sign-in
RedirectUri Required. Post-login redirect, e.g. authentication/login-callback
PostLogoutRedirectUri Required. Post-logout redirect, e.g. authentication/logout-callback
{
  "Aetherweave": {
    "Security": {
      "Oidc": {
        "Authority": "https://identity.example.com",
        "ClientId": "orders-web",
        "ResponseType": "code",
        "DefaultScopes": [ "openid", "profile", "orders-api" ],
        "RedirectUri": "authentication/login-callback",
        "PostLogoutRedirectUri": "authentication/logout-callback"
      }
    }
  }
}

Quick Start

1. Register OIDC client authentication

builder.Services.AddAetherweaveOidcClientAuthentication(builder.Configuration);

// Or with a custom section name
builder.Services.AddAetherweaveOidcClientAuthentication(builder.Configuration, "MyApp:Oidc");

This reads and validates AetherweaveOidcOptions from configuration, then calls AddOidcAuthentication(...) mapping Authority, ClientId, ResponseType, RedirectUri, PostLogoutRedirectUri, and appending every entry of DefaultScopes to ProviderOptions.DefaultScopes.

2. Register authorized HttpClients

AddAetherweaveOidcHttpClients returns a builder whose typed clients are registered via Zwedze.Aetherweave.Http and automatically attach the current OIDC access token through AuthorizationMessageHandler.

builder.Services
    .AddAetherweaveOidcHttpClients(authorizedUrls: ["https://api.example.com"])
    .AddAetherweaveHttpClient<IOrderServiceClient, OrderServiceClient>(
        builder.Configuration,
        "OrderService");

authorizedUrls are the base addresses the access token is allowed to be attached to — pass the same URLs registered with AuthorizationMessageHandler (matches Blazor WebAssembly's standard WithAuthorizationMessageHandler set up in Program.cs).

3. Attach auth to any other IHttpClientBuilder

For clients not registered through AddAetherweaveOidcHttpClients, the WithAuth extension attaches the same handler directly:

builder.Services
    .AddHttpClient<IOrderServiceClient, OrderServiceClient>()
    .WithAuth(["https://api.example.com"]);

API Reference

Member Signature
AddAetherweaveOidcClientAuthentication (this IServiceCollection, IConfiguration, string sectionName = "Aetherweave:Security:Oidc") → IServiceCollection
AddAetherweaveOidcHttpClients (this IServiceCollection, IEnumerable<string> authorizedUrls, string sectionName = "Aetherweave:Security:Oidc") → OidcHttpClientBuilder
OidcHttpClientBuilder.AddAetherweaveHttpClient<TInterface, TImplementation> (IConfiguration, string clientName) → IHttpClientBuilder — registers via Zwedze.Aetherweave.Http and attaches AuthorizationMessageHandler
IHttpClientBuilder.WithAuth (IEnumerable<string> authorizedUrls) → IHttpClientBuilder — attaches AuthorizationMessageHandler to an existing builder
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
0.2.5 90 9/3/2026
0.2.5-pre.2 65 9/3/2026
0.2.5-pre.1 65 8/13/2026
0.2.5-extend-db-registratio... 60 8/31/2026
0.2.4 106 8/13/2026
0.2.4-pre.1 71 8/13/2026
0.2.3 92 8/6/2026
0.2.3-pre.1 69 8/6/2026
0.2.2 102 8/5/2026
0.2.2-pre.1 61 7/30/2026
0.2.1 105 7/29/2026
0.2.1-pre.1 70 7/29/2026
0.2.0 109 7/25/2026
0.1.2-pre.3 66 7/25/2026
0.1.2-pre.1 64 7/24/2026