2 unstable releases

0.5.0 Apr 28, 2024
0.1.0 Oct 31, 2023

#959 in Authentication

Download history 49/week @ 2024-03-14 47/week @ 2024-03-21 87/week @ 2024-03-28 34/week @ 2024-04-04 34/week @ 2024-04-11 39/week @ 2024-04-18 545/week @ 2024-04-25 1004/week @ 2024-05-02 1122/week @ 2024-05-09 1434/week @ 2024-05-16 1574/week @ 2024-05-23 1258/week @ 2024-05-30 1704/week @ 2024-06-06 1359/week @ 2024-06-13 1768/week @ 2024-06-20 1347/week @ 2024-06-27

6,432 downloads per month
Used in 12 crates (3 directly)

MPL-2.0 license

33KB
668 lines

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

~2.6–3.5MB
~78K SLoC