pub enum AuthMethod {
Pwd,
Totp,
RecoveryCode,
Webauthn,
}Expand description
Authentication method that contributed to a session’s authentication. The variants map 1:1 to RFC 8176 AMR values.
Variants§
Pwd
Username + password. Always present in a sui-id session.
Totp
TOTP authenticator app code.
RecoveryCode
One of the user’s pre-issued recovery codes.
Webauthn
WebAuthn assertion (passkey / hardware key).
Implementations§
Source§impl AuthMethod
impl AuthMethod
Sourcepub fn as_amr(self) -> &'static str
pub fn as_amr(self) -> &'static str
The RFC 8176 AMR token for this method. These strings appear
verbatim in the amr array of issued ID tokens; relying
parties match on them.
Sourcepub fn is_second_factor(self) -> bool
pub fn is_second_factor(self) -> bool
Whether this method counts as a second factor — i.e. it is neither password nor a knowledge-only credential. Used to derive the ACR level.
Sourcepub fn is_phishing_resistant(self) -> bool
pub fn is_phishing_resistant(self) -> bool
Whether this method is phishing-resistant in the sense that the credential cannot be replayed by an attacker who has captured the user’s keystrokes. WebAuthn is; TOTP is not (the 6-digit code is interceptable inside its 30-second window).
Trait Implementations§
Source§impl Clone for AuthMethod
impl Clone for AuthMethod
Source§fn clone(&self) -> AuthMethod
fn clone(&self) -> AuthMethod
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for AuthMethod
Source§impl Debug for AuthMethod
impl Debug for AuthMethod
Source§impl<'de> Deserialize<'de> for AuthMethod
impl<'de> Deserialize<'de> for AuthMethod
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for AuthMethod
Source§impl Hash for AuthMethod
impl Hash for AuthMethod
Source§impl PartialEq for AuthMethod
impl PartialEq for AuthMethod
Source§fn eq(&self, other: &AuthMethod) -> bool
fn eq(&self, other: &AuthMethod) -> bool
self and other values to be equal, and is used by ==.