#[non_exhaustive]pub enum WebauthnError {
Config(String),
InvalidChallenge(String),
CredentialNotFound(String),
VerificationFailed(String),
DuplicateCredential(String),
UserNotFound(String),
ChallengeExpired,
UnsupportedAlgorithm(i32),
SignatureVerificationFailed,
AttestationError(String),
UserVerificationRequired,
PolicyViolation(String),
}Expand description
Error type for WebAuthn operations.
The type is #[non_exhaustive]: matching on it requires a wildcard arm.
§Security note
Error strings may echo attacker-controlled fragments of the request being verified (e.g. a base64 payload or an origin string). They are intended for server-side logs and debugging. Do not forward raw error messages to untrusted clients; surface only a generic verification-failed response.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Config(String)
A caller-supplied configuration value is invalid or inconsistent.
InvalidChallenge(String)
The presented challenge is unknown, malformed, or was already consumed (single-use replay protection triggered).
CredentialNotFound(String)
The referenced credential does not exist for the given user/scope.
VerificationFailed(String)
Generic verification failure (challenge mismatch, bad origin, wrong
type field, truncated authenticator data, RP ID hash mismatch, …).
DuplicateCredential(String)
The registration presented a credential ID that is already registered.
UserNotFound(String)
The referenced user does not exist.
ChallengeExpired
The challenge was consumed after its freshness window elapsed.
UnsupportedAlgorithm(i32)
The COSE algorithm is not one of the supported/allowed algorithms.
SignatureVerificationFailed
ring rejected the cryptographic signature.
AttestationError(String)
The attestation object or statement could not be parsed, or attestation verification failed for a non-signature reason (unsupported/unknown format, untrusted chain, expired certificate, AAGUID extension mismatch, …).
Signature failures surface as WebauthnError::SignatureVerificationFailed.
UserVerificationRequired
A ceremony required user verification
(crate::policy::UserVerificationPolicy::Required) but the
authenticator’s UV flag was clear.
PolicyViolation(String)
The presented credential violates the caller’s
crate::policy::CredentialPolicy (backup-eligibility policy, …).
Trait Implementations§
Source§impl Debug for WebauthnError
impl Debug for WebauthnError
Source§impl Display for WebauthnError
impl Display for WebauthnError
Source§impl Error for WebauthnError
impl Error for WebauthnError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()