DSInternals.Win32.WebAuthn
3.2.0
Prefix Reserved
dotnet add package DSInternals.Win32.WebAuthn --version 3.2.0
NuGet\Install-Package DSInternals.Win32.WebAuthn -Version 3.2.0
<PackageReference Include="DSInternals.Win32.WebAuthn" Version="3.2.0" />
<PackageVersion Include="DSInternals.Win32.WebAuthn" Version="3.2.0" />
<PackageReference Include="DSInternals.Win32.WebAuthn" />
paket add DSInternals.Win32.WebAuthn --version 3.2.0
#r "nuget: DSInternals.Win32.WebAuthn, 3.2.0"
#:package DSInternals.Win32.WebAuthn@3.2.0
#addin nuget:?package=DSInternals.Win32.WebAuthn&version=3.2.0
#tool nuget:?package=DSInternals.Win32.WebAuthn&version=3.2.0
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
challengemust be generated with a cryptographically secure random number generator.
Related Packages
- DSInternals.Win32.WebAuthn.Adapter — bridge that exposes this library through the Fido2.Models types from fido2-net-lib.
- DSInternals.Passkeys — PowerShell module for registering passkeys on behalf of Microsoft Entra ID and Okta users.
Links
License
Released under the MIT License.
| Product | Versions 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. |
-
.NETFramework 4.8
- Microsoft.Bcl.Memory (>= 10.0.5)
- Microsoft.Identity.Client (>= 4.82.1)
- Microsoft.NET.ILLink.Tasks (>= 10.0.8)
- System.Formats.Cbor (>= 10.0.8)
- System.IdentityModel.Tokens.Jwt (>= 8.15.0)
- System.Text.Json (>= 10.0.3)
-
net10.0-windows7.0
- Microsoft.Bcl.Memory (>= 10.0.5)
- Microsoft.Identity.Client (>= 4.82.1)
- Microsoft.NET.ILLink.Tasks (>= 10.0.8)
- NSec.Cryptography (>= 25.4.0)
- System.Diagnostics.EventLog (>= 9.0.16)
- System.Formats.Cbor (>= 10.0.8)
- System.IdentityModel.Tokens.Jwt (>= 8.15.0)
-
net8.0-windows7.0
- Microsoft.Bcl.Memory (>= 10.0.5)
- Microsoft.Identity.Client (>= 4.82.1)
- Microsoft.NET.ILLink.Tasks (>= 10.0.8)
- NSec.Cryptography (>= 25.4.0)
- System.Diagnostics.EventLog (>= 9.0.16)
- System.Formats.Cbor (>= 10.0.8)
- System.IdentityModel.Tokens.Jwt (>= 8.15.0)
- System.Security.Cryptography.Cng (>= 5.0.0)
- System.Text.Json (>= 10.0.3)
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.
- `WebAuthnApi.AuthenticatorMakeCredential` / `AuthenticatorGetAssertion` now prefer the native `pbRegistrationResponseJSON` / `pbAuthenticationResponseJSON` returned by recent WebAuthn API versions, deserializing the full credential (including `clientExtensionResults`) verbatim from the OS-produced JSON. The legacy field-by-field assembly remains as a fallback for older OS versions.
- `AuthenticatorDetails.AuthenticatorId` (surfaced by `Get-PasskeyAuthenticator`) was renamed to `AaGuid` and its type changed from `byte[]` to `Guid?`. The big-endian AAGUID returned by the Win32 API is now decoded and exposed as a `Guid` instead of a Base64Url string.
- Added a `BrowserInPrivateMode` flag (`WEBAUTHN_AUTHENTICATOR_HINTS_FLAGS_BROWSER_IN_PRIVATE_MODE`) so callers can signal that the request originates from a browser running in private/incognito mode; no information about the operation is written to the Windows event log in that case.