Knowit.NemLogin 0.1.0

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

Knowit.NemLogin

Core SAML 2.0 / OIOSAML 3 + 4 service-provider primitives for integrating Danish NemLog-in 3 (MitID) in .NET applications.

Framework-agnostic — pair with Knowit.NemLogin.Web for ASP.NET Core, or use the core services directly from any host that needs to build, validate, sign, or decrypt OIOSAML messages.

Package family

Package Role
Knowit.NemLogin Core SAML primitives, framework-agnostic. (you are here)
Knowit.NemLogin.Web ASP.NET Core authentication handler + endpoint mappings
Knowit.NemLogin.Umbraco Umbraco Members integration — auto-provisioning, group mapping, Members-scheme sign-in
Knowit.NemLogin.AzureKeyVault ICertificateProvider backed by Azure Key Vault — keep SP signing/encryption certs out of source control

What's in this package

  • INemLoginService — single entry point for SP-initiated AuthnRequests, AuthnResponse processing (signature + decryption + 15-step validation), LogoutRequest/Response handling, and SP metadata generation.
  • NemLoginOptions — POCO configuration: environment, OIOSAML version, attribute profiles, certs, IdP metadata URL, clock skew, replay-cache policy, event hooks.
  • IOioSamlProfile — per-version protocol behavior for OIOSAML 3.0.3 and OIOSAML 4.0.0.
  • NemLoginEvents — framework-agnostic pipeline hooks (OnCreatingAuthnRequest, OnAssertionValidated, OnAuthnResponseReceived, OnGeneratingMetadata, OnCreatingLogoutRequest, OnRemoteSignOut, OnAuthenticationFailed).
  • ICertificateProvider — pluggable cert resolution (file / store / Key Vault via the companion package).
  • IAssertionReplayCache — pluggable replay protection (in-memory default, Redis or equivalent for multi-node).
  • Strongly-typed NemLoginAttributes for canonical attribute extraction across OIOSAML 3 and 4 (person, professional, NSIS LoA/IAL/AAL, v4-only CPR-IAL / isRobot / allowQualifiedSigning).

Quick start

builder.Services.Configure<NemLoginOptions>(o =>
{
    o.Environment = NemLoginEnvironment.PreProduction;
    o.OioSamlVersion = OioSamlVersion.V3;
    o.AllowedProfiles = AttributeProfile.DkPerson;
    o.EntityId = "https://myapp.example.dk/saml";
    o.AssertionConsumerServiceUrl = new Uri("https://myapp.example.dk/nemlogin/callback");
    o.IdentityProviderMetadataUrl = new Uri("https://www.nemlog-in.dk/files/oiosaml3-idp-preprod-inttest.xml");
    o.SigningCertificates.Add(CertificateReference.FromFile("sp.pfx", "<password>"));
});

// For ASP.NET Core hosts, install Knowit.NemLogin.Web and call
// `.AddNemLogin()` on the AuthenticationBuilder — it registers the core
// services automatically.

Repository

github.com/mustap/Knowit-NemLogin — full documentation, ARCHITECTURE.md, getting-started, hooks-cookbook, production-checklist, operational-runbook, and migration guides for Sustainsys.Saml2, ITfoxtec.Identity.Saml2 direct, and digst/OIOSAML.Net.

License

MIT — see LICENSE.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  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 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 (2)

Showing the top 2 NuGet packages that depend on Knowit.NemLogin:

Package Downloads
Knowit.NemLogin.Web

ASP.NET Core integration for Knowit.NemLogin — authentication handler, endpoint mappings, claims transformation. Targets NemLog-in 3 (OIOSAML 3 and 4).

Knowit.NemLogin.AzureKeyVault

Azure Key Vault certificate provider for Knowit.NemLogin. Lets the SP signing + encryption certs live in Key Vault and rotate without redeploys.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0 129 5/13/2026