DSInternals.Win32.WebAuthn 3.1.0

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

DSInternals.Win32.WebAuthn

Passkeys / FIDO2 / W3C Web Authentication .NET Library for Windows Desktop and CLI Applications

DSInternals.Win32.WebAuthn is a managed wrapper of the low-level Windows 10+ WebAuthn API (defined in webauthn.h and implemented in webauthn.dll). It allows .NET applications to directly interact with passkeys and FIDO2 authenticators — including Windows Hello, Microsoft Authenticator, YubiKey, Feitian, and Crayonic — on Windows.

The same API is used by browsers such as Chromium and Firefox to implement passwordless web authentication, and can also be used by any .NET desktop or CLI application.

Requirements

  • Windows 10 version 1903 or newer
  • One of: .NET 10, .NET 8, or .NET Framework 4.8

Usage

The main entry point is the WebAuthnApi class in the DSInternals.Win32.WebAuthn namespace.

Registration (Attestation)

using DSInternals.Win32.WebAuthn;

var rp = new RelyingPartyInformation()
{
    Id = "login.microsoft.com",
    Name = "Microsoft"
};

var user = new UserInformation()
{
    Name = "john.doe@outlook.com",
    DisplayName = "John Doe",
    Id = Base64UrlConverter.FromBase64UrlString("TUY65dH-Otl4jMdTRvlFQ1aApACYsuqGKSPQDQc1Bd4WVyw")
};

var challenge = new byte[] { 0, 1, 2, 3 };
var api = new WebAuthnApi();

var response = api.AuthenticatorMakeCredential(
    rp,
    user,
    challenge,
    UserVerificationRequirement.Required,
    AuthenticatorAttachment.Any);

Authentication (Assertion)

using DSInternals.Win32.WebAuthn;

var api = new WebAuthnApi();
var challenge = new byte[] { 0, 1, 2, 3 };

var response = api.AuthenticatorGetAssertion(
    "login.microsoft.com",
    challenge,
    UserVerificationRequirement.Required,
    AuthenticatorAttachment.CrossPlatform);

Async variants (AuthenticatorMakeCredentialAsync and AuthenticatorGetAssertionAsync) are also available and support cancellation.

The samples above are illustrative and not production-ready: they omit validation and use hardcoded values. In particular, the challenge must be generated with a cryptographically secure random number generator.

License

Released under the MIT License.

Product Compatible and additional computed target framework versions.
.NET net8.0-windows7.0 is compatible.  net9.0-windows was computed.  net10.0-windows was computed.  net10.0-windows7.0 is compatible. 
.NET Framework net48 is compatible.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on DSInternals.Win32.WebAuthn:

Package Downloads
DSInternals.Win32.WebAuthn.Adapter

Bridge between Fido2.Models and DSInternals.Win32.WebAuthn packages

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.1.0 83 5/14/2026
3.0.0 192 5/7/2026
2.1.0 1,029 4/5/2026
2.0.0 108 4/3/2026
1.0.6 7,896 1/16/2025
1.0.5 297 11/14/2024
1.0.4 1,104 10/6/2024
1.0.3 323 8/16/2024
1.0.2 291 8/14/2024
1.0.0 293 8/11/2024

- Added an optional `hostName` parameter to `AuthenticatorMakeCredential` / `AuthenticatorMakeCredentialAsync` that derives the WebAuthn origin and substitutes for a missing `rp.id` (useful for relying parties such as Okta that omit it from server-issued options).
- Reshaped Entra and Okta payloads.
- `AuthenticatorSelectionCriteria.ResidentKey` is now nullable so it can default to `Preferred` when unspecified.