pub struct PublicKeyCredentialRequestOptions<'rp_id, 'prf_first, 'prf_second> {
pub challenge: Challenge,
pub timeout: NonZeroU32,
pub rp_id: &'rp_id RpId,
pub user_verification: UserVerificationRequirement,
pub hints: Hints,
pub extensions: Extension<'prf_first, 'prf_second>,
}Expand description
The PublicKeyCredentialRequestOptions
to send to the client when authenticating a credential.
This does not contain allowCredentials.
Fields§
§challenge: Challenge§timeout: NonZeroU32Note we require a positive value despite the spec allowing an optional nonnegative value. This jives
with the fact that in-memory storage is required when serializable_server_state is not enabled
when authenticating credentials as no timeout would make out-of-memory (OOM) conditions more likely.
rp_id: &'rp_id RpIdrpId.
This MUST be the same as the PublicKeyCredentialCreationOptions::rp_id used when the credential was registered.
user_verification: UserVerificationRequirement§hints: Hints§extensions: Extension<'prf_first, 'prf_second>Implementations§
Source§impl<'rp_id> PublicKeyCredentialRequestOptions<'rp_id, '_, '_>
impl<'rp_id> PublicKeyCredentialRequestOptions<'rp_id, '_, '_>
Sourcepub fn passkey<'a: 'rp_id>(rp_id: &'a RpId) -> Self
pub fn passkey<'a: 'rp_id>(rp_id: &'a RpId) -> Self
Creates a PublicKeyCredentialRequestOptions with Self::user_verification set to
UserVerificationRequirement::Required and Self::timeout set to FIVE_MINUTES.
Note rp_id must be the same as the PublicKeyCredentialCreationOptions::rp_id when the
credential was registered.
§Examples
assert!(matches!(
PublicKeyCredentialRequestOptions::passkey(&RpId::Domain(AsciiDomain::try_from("example.com".to_owned())?)).user_verification,
UserVerificationRequirement::Required
));Sourcepub fn second_factor<'a: 'rp_id>(rp_id: &'a RpId) -> Self
pub fn second_factor<'a: 'rp_id>(rp_id: &'a RpId) -> Self
Creates a PublicKeyCredentialRequestOptions with Self::user_verification set to
UserVerificationRequirement::Discouraged and Self::timeout set to FIVE_MINUTES.
Note rp_id must be the same as the PublicKeyCredentialCreationOptions::rp_id when the
credentials were registered.
§Examples
assert!(matches!(
PublicKeyCredentialRequestOptions::second_factor(&RpId::Domain(AsciiDomain::try_from("example.com".to_owned())?)).user_verification,
UserVerificationRequirement::Discouraged
));