37 releases

0.5.0-dev Oct 31, 2023
0.4.8 Nov 11, 2022
0.4.7 Sep 25, 2022
0.4.2-beta.4 Jul 29, 2022
0.1.4 May 7, 2019

#23 in Authentication

Download history 16047/week @ 2023-12-16 1148/week @ 2023-12-23 4937/week @ 2023-12-30 6159/week @ 2024-01-06 5480/week @ 2024-01-13 9849/week @ 2024-01-20 7071/week @ 2024-01-27 8405/week @ 2024-02-03 9575/week @ 2024-02-10 2611/week @ 2024-02-17 5063/week @ 2024-02-24 1714/week @ 2024-03-02 1596/week @ 2024-03-09 1719/week @ 2024-03-16 1638/week @ 2024-03-23 1723/week @ 2024-03-30

6,946 downloads per month
Used in devoyage-subgraph

MPL-2.0 license

550KB
7.5K SLoC

Webauthn-rs

Webauthn is a modern approach to hardware based authentication, consisting of a user with an authenticator device, a browser or client that interacts with the device, and a server that is able to generate challenges and verify the authenticator's validity.

Users are able to enroll their own tokens through a registration process to be associated to their accounts, and then are able to login using the token which performas a cryptographic authentication.

This library aims to provide useful functions and frameworks allowing you to integrate webauthn into Rust web servers. This means the library implements the Relying Party component of the Webauthn/FIDO2 workflow. We provide template and example javascript and wasm bindings to demonstrate the browser interactions required.

Code of Conduct

See our code of conduct

Blockchain Support Policy

This project does not and will not support any blockchain related use cases. We will not accept issues from organisations (or employees thereof) whose primary business is blockchain, cryptocurrency, NFTs or so-called “Web 3.0 technology”. This statement does not affect the rights and responsibilities granted under the project’s open source license(s).

If you have further questions about the scope of this statement and whether it impacts you, please email webauthn at firstyear.id.au

Documentation

This library consists of multiple major parts.

A safe, use-case driven api, which is defined in Webauthn-RS

The low level, protocol level interactions which is defined in Webauthn-Core-RS

Protocol bindings which are defined in Webauthn-RS-proto

The FIDO MDS (authenticator transparency) parser FIDO-MDS

We strongly recommend you use the safe api, as webauthn has many sharp edges and ways to hold it wrong!

Demonstration

You can test this library via our demonstration site

Or you can run the demonstration your self locally with:

cd compat_tester/webauthn-rs-demo
cargo run

For additional configuration options for the demo site:

cargo run -- --help

Known Supported Keys/Harwdare

We have extensively tested a variety of keys and devices, not limited to:

  • Yubico 5c / 5ci / FIPS / Bio
  • TouchID / FaceID (iPhone, iPad, MacBook Pro)
  • Android
  • Windows Hello (TPM)
  • Softtokens

If your key/browser combination don't work (generally due to missing crypto routines) please conduct a compatability test and then open an issue so that we can resolve the issue!

Known BROKEN Keys/Hardware

  • Pixel 3a / Pixel 4 + Chrome - Does not send correct attestation certificates, and ignores requested algorithms. Not resolved.
  • Windows Hello with Older TPMs - Often use RSA-SHA1 signatures over attestation which may allow credential compromise/falsification.

Standards Compliance

This library has been carefully implemented to follow the w3c standard for webauthn level 3+ processing to ensure secure and correct behaviour. We support most major extensions and key types, but we do not claim to be standards complaint because:

  • We have enforced extra constraints in the library that go above and beyond the security guarantees the standard offers.
  • We do not support certain esoteric options.
  • We do not support all cryptographic primitive types (only limited to secure ones).
  • A large number of advertised features in webauthn do not function in the real world.

This library has passed a security audit performed by SUSE product security. Other security reviews are welcome!

Dependencies

~10MB
~227K SLoC