Demo of Web Authentication API with .net core
Overview: https://auth0.com/blog/web-authentication-webauthn-overview-demo-tool/#:~:text=What%20is%20WebAuthn,-WebAuthn%2C%20otherwise%20known&text=In%20summary%2C%20Web%20Authentication%20is,based%20on%20public%20key%20cryptography. Guide: https://webauthn.guide/
Notes:
- to run the hostname must either be running under localhost or https.
- Not a valid way to authenticate if the user shares a login on the trusted device
- Need to update
pubKeyCredParams
on register and sign in if you prefer usb key to windows hello
Stolen heavily from
- https://github.com/MicrosoftEdge/webauthnsample/blob/fbe28c87a34c8d82c60c7be77e8f816c171eba14/fido.js
- https://docs.microsoft.com/en-us/microsoft-edge/dev-guide/windows-integration/web-authentication#authenticate-your-user
- https://www.w3.org/TR/webauthn-2/#public-key-credential-source
- https://www.iana.org/assignments/cose/cose.xhtml#algorithms
- https://docs.microsoft.com/en-us/dotnet/api/system.security.cryptography.rsacryptoserviceprovider.signdata?view=netcore-3.1
TODO:
- clean up parsing
- verify rest of
AuthenticatorAssertionResponse.authenticatorData
on sign in - Add a database
- Use WebAuthn packages if possible