密钥、FIDO2 和 WebAuthn .NET 库。
A fully working and battle tested library for passkeys (FIDO2 and WebAuthn) on .NET Releases & Change log
Bitwarden Passwordless API
The quickest way to get started with FIDO2 and WebAuthn is with the Bitwarden Passwordless API. It's free up to 10k users and a faster way to start using passkeys on your website or mobile app.
Bitwarden Passwordless.dev supports .NET Framework as well as the latest .net 8+.
Our purpose is to enable passwordless sign in for all .NET apps (asp, core, native).
To provide a developer friendly and well tested .NET FIDO2 Server / WebAuthn relying party library for the easy validation of registration (attestation) and authentication (assertion) of FIDO2 / WebAuthn credentials, in order to increase the adoption of the technology, ultimately defeating phishing attacks.
This project is part of the .NET foundation
Wondering if you should use what's in .NET 10 or this library? I've worked together with Microsoft on their passkey implementation and how it relates to this library, so I can share some perspective that may be aid in your decision:
When picking Microsoft asp.net identity is a good idea:
When picking this library is a good idea:
I'm happy that Microsoft is finally joining the passkey train, but this library is probably still what you want to use unless you're running the vanilla asp.net Identity-stack. At least for the time beeing.
Requirements: .NET 8.0 or later
dotnet add package Fido2
To use the ASP.NET Core helpers:
dotnet add package Fido2.AspNet
For Blazor WebAssembly support:
dotnet add package Fido2.BlazorWebAssembly
⚠️ Breaking Changes: If upgrading from v3.x, see the Upgrade Guide for migration instructions.
The passwordless web is here. FIDO2 / WebAuthn is a modern, stable and open authentication standard, supported by browsers and many large tech companies such as Microsoft, Google etc. The main driver is to allow a user to login without passwords, creating passwordless flows or strong MFA for user signup/login on websites. The standard is not limited to web applications with support coming to native apps. The technology builds on public/private keys, allowing authentication to happen without sharing a secret between the user & website. This brings many benefits, such as easier and safer logins and makes phishing attempts extremely hard.
Read more:
Only some options are mentioned here, see the Configuration class for all options
fido2:MDSCacheDirPath - App Secret / environment variable that sets the cache path for the MDS. Defaults to "current user's temporary folder"/fido2mdscache. Optional when using the default MetadataService provider.services.AddFido2(options =>
{
options.ServerDomain = "example.com";
options.ServerName = "Example App";
options.Origins = new HashSet<string> { "https://example.com" };
});
public class AuthController : Controller
{
private readonly IFido2 _fido2;
public AuthController(IFido2 fido2)
{
_fido2 = fido2;
}
}
For integration patterns, see:
To add FIDO2 credentials to an existing user account, start by creating options for the client.
…
When the client returns a response, verify and register the credentials.
…
For user authentication, create assertion options based on registered credentials.
…
When the client returns a response, verify it and accept the login.
…
https://www.nuget.org/packages/Fido2/ and https://www.nuget.org/packages/Fido2.Models/
See Contributing for information about contributing to the project.
This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community. For more information see the .NET Foundation Code of Conduct.
For security and penetration testing, please see our Vulnerability Disclosure Program
This project exists thanks to all the people who contribute. [Contribute].
Become a financial contributor and help us sustain our community. [Contribute]
Support this project with your organization. Your logo will show up here with a link to your website. [Contribute]
This project is supported by the .NET Foundation.
Inconsistent chain validation on Windows / Linux which results to 2 failed unit tests on Linux
UserPresent flag enforcement
Invalid certificate chain error using Neowave Winkeo key
Why certificate revocation check is handled manually during Metadata BLOB validation?
Proposal: publish a System.Security.Cryptography-only package without NSec/EdDSA
[Blazor WebAssembly]Failed to fetch dynamically imported module
[Blazor WebAssembly] Not works with blazor hybrid + winform
Add example/demo for multiple or dynamic origins
Support for Secure Payment Confirmation
Hard-coded Root Cert in source