Asgard.Heimdall.JwtSigning.AspNetCore 0.2.0

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

Asgard.Heimdall.JwtSigning.AspNetCore

ASP.NET Core integration for Asgard.Heimdall.JwtSigning.

This package exposes discovery and JWKS endpoints so Asgard resource services can validate JWTs through the existing host.auth.jwt flow.

Endpoints

/.well-known/openid-configuration
/.well-known/jwks.json

Usage

builder.Services.AddAsgardHeimdallJwtSigning(options =>
{
    options.Issuer = "https://auth.example.com/scm";
    options.Audience = "asgard-api";
    options.DiscoveryPathPrefix = "/scm";
    options.KeyId = "main-key";
    options.RsaPrivateKeyPem = privateKeyPem;
    options.RsaPublicKeyPem = publicKeyPem;
});

app.MapAsgardHeimdallJwtSigningDiscovery();

When DiscoveryPathPrefix is set to /scm, the package maps:

/scm/.well-known/openid-configuration
/scm/.well-known/jwks.json

The discovery document keeps the issuer contract aligned:

issuer == options.Issuer
jwks_uri == options.Issuer + "/.well-known/jwks.json"

For reverse proxy or gateway rewrites where the externally reachable JWKS URL is different, set JwksUriOverride as an escape hatch.

Your application still implements its own login API. Inside that API, inject IAsgardJwtIssuer and issue a token after your own user validation succeeds.

app.MapPost("/login", (IAsgardJwtIssuer issuer) =>
{
    var token = issuer.Issue(new AsgardJwtSubject
    {
        Subject = "user-1",
        UserId = "user-1",
        TenantId = "11111111-2222-3333-4444-555555555555",
        Roles = ["user"],
        Permissions = ["profile.read"],
        Scope = ["api"]
    });

    return Results.Ok(token);
});

Resource Service Configuration

Asgard resource services do not need to reference this package. They keep using Asgard's built-in JWT authentication and point issuerTemplate to the issuer hosted by this package.

host:
  auth:
    enabled: true
    jwt:
      issuerTemplate: "https://auth.example.com/scm"
      audience: "asgard-api"
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.0 98 5/29/2026
0.1.0 105 5/16/2026