mozilla / authenticator-rs

Rust library to interact with Security Keys, used by Firefox
https://crates.io/crates/authenticator
Mozilla Public License 2.0
276 stars 72 forks source link

Expose `AuthenticatorError::CredentialExcluded` in public API #262

Closed jschanck closed 1 year ago

jschanck commented 1 year ago

The CTAP2 authenticatorMakeCredential command takes an excludeList parameter that is used to prevent the user from storing multiple credentials for the same account on one authenticator. When a token finds that it already stores a credential from excludeList, it returns CTAP2_ERR_CREDENTIAL_EXCLUDED.

In Firefox, we need to show a prompt that guides the user towards retrying with another authenticator when we see CTAP2_ERR_CREDENTIAL_EXCLUDED (Bug 1831392). This patch exposes a top-level error code which we can catch in authrs_bridge.