PublicKeyCredentialRequestOptions

Struct PublicKeyCredentialRequestOptions 

Source
pub struct PublicKeyCredentialRequestOptions {
    pub challenge: Bytes,
    pub timeout: Option<u32>,
    pub rp_id: Option<String>,
    pub allow_credentials: Option<Vec<PublicKeyCredentialDescriptor>>,
    pub user_verification: UserVerificationRequirement,
    pub hints: Option<Vec<PublicKeyCredentialHints>>,
    pub attestation: AttestationConveyancePreference,
    pub attestation_formats: Option<Vec<AttestationStatementFormatIdentifiers>>,
    pub extensions: Option<AuthenticationExtensionsClientInputs>,
}
Expand description

This type supplies get() requests with the data it needs to generate an assertion. Its challenge member MUST be present, while its other members are OPTIONAL.

https://w3c.github.io/webauthn/#dictdef-publickeycredentialrequestoptions

Fields§

§challenge: Bytes

This member specifies a challenge that the authenticator signs, along with other data, when producing an authentication assertion. See the Cryptographic Challenges security consideration.

§timeout: Option<u32>

This OPTIONAL member specifies a time, in milliseconds, that the Relying Party is willing to wait for the call to complete. The value is treated as a hint, and MAY be overridden by the client.

§rp_id: Option<String>

This OPTIONAL member specifies the RP ID claimed by the Relying Party. The client MUST verify that the Relying Party’s origin matches the scope of this RP ID. The authenticator MUST verify that this RP ID exactly equals the rpId of the credential to be used for the authentication ceremony.

If omitted, its value will be the requesting origin’s effective domain.

§allow_credentials: Option<Vec<PublicKeyCredentialDescriptor>>

This OPTIONAL member is used by the client to find authenticators eligible for this authentication ceremony. It can be used in two ways:

  • If the user account to authenticate is already identified (e.g. if the user has entered a username), then the Relying Party SHOULD use this member to list credential descriptors for credential records in the user account. This SHOULD usually include all credential records in the user account.

    The items SHOULD specify PublicKeyCredentialDescriptor::transports whenever possible. This helps the client optimize the user experience for any given situation. Also note that the Relying Party does not need to filter the list when requesting user verification — the client will automatically ignore non-eligible credentials if Self::user_verification is set to required.

    See also the Privacy leak via credential IDs privacy consideration.

  • If the user account to authenticate is not already identified, then the Relying Party MAY leave this member empty or unspecified. In this case, only discoverable credentials will be utilized in this authentication ceremony, and the user account MAY be identified by the of the resulting AuthenticatorAssertionResponse::user_handle. If the available authenticators contain more than one discoverable credential scoped to the Relying Party, the credentials are displayed by the client platform or authenticator for the user to select from.

If not empty, the client MUST return an error if none of the listed credentials can be used.

The list is ordered in descending order of preference: the first item in the list is the most preferred credential, and the last is the least preferred.

§user_verification: UserVerificationRequirement

This OPTIONAL member specifies the Relying Party’s requirements regarding user verification for the get() operation. The value SHOULD be a member of UserVerificationRequirement but client platforms MUST ignore unknown values, treating an unknown value as if the member does not exist and using its default value. Eligible authenticators are filtered to only those capable of satisfying this requirement.

See UserVerificationRequirement for the description of this field’s values and semantics.

§hints: Option<Vec<PublicKeyCredentialHints>>

This OPTIONAL member contains zero or more elements from PublicKeyCredentialHints` to guide the user agent in interacting with the user.

This field ignores unknown hint values at deserialization.

§attestation: AttestationConveyancePreference

The Relying Party MAY use this OPTIONAL member to specify a preference regarding attestation conveyance. Its value SHOULD be a member of AttestationConveyancePreference. Client platforms MUST ignore unknown values, treating an unknown value as if the member does not exist, therefore acting as the default value.

The default value is AttestationConveyancePreference::None

§attestation_formats: Option<Vec<AttestationStatementFormatIdentifiers>>

The Relying Party MAY use this OPTIONAL member to specify a preference regarding the attestation statement format used by the authenticator. Values SHOULD be taken from the IANA “WebAuthn Attestation Statement Format Identifiers” registry IANA-WebAuthn-Registries established by RFC8809. Values are ordered from most preferable to least preferable. This parameter is advisory and the authenticator MAY use an attestation statement not enumerated in this parameter.

The default value is the empty list, which indicates no preference.

§extensions: Option<AuthenticationExtensionsClientInputs>

The Relying Party MAY use this OPTIONAL member to provide client extension inputs requesting additional processing by the client and authenticator.

See AuthenticationExtensionsClientInputs for the list of currenly supported WebAuthn Extensions.

Trait Implementations§

Source§

impl Debug for PublicKeyCredentialRequestOptions

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for PublicKeyCredentialRequestOptions

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for PublicKeyCredentialRequestOptions

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,