pub struct CollectedClientData<E = ()>{
pub ty: ClientDataType,
pub challenge: String,
pub origin: String,
pub cross_origin: Option<bool>,
pub extra_data: E,
pub unknown_keys: IndexMap<String, Value>,
}Expand description
The client data represents the contextual bindings of both the Relying Party and the client. It is a key-value mapping whose keys are strings. Values can be any type that has a valid encoding in JSON.
Note: The
CollectedClientDatamay be extended in the future. Therefore it’s critical when parsing to be tolerant of unknown keys and of any reordering of the keys
This struct conforms to the JSON byte serialization format expected of CollectedClientData,
detailed in section 5.8.1.1 Serialization of the WebAuthn spec. Namely the following
requirements:
type,challenge,origin,crossOriginmust always be present in the serialized format in that order.- Any extra parameters must keep the order in which they were used in the signature, hence the
use of
IndexMap.
Fields§
§ty: ClientDataTypeThis member contains the value ClientDataType::Create when creating new credentials, and
ClientDataType::Get when getting an assertion from an existing credential. The purpose
of this member is to prevent certain types of signature confusion attacks (where an attacker
substitutes one legitimate signature for another).
challenge: StringThis member contains the base64url encoding of the challenge provided by the Relying Party. See the Cryptographic Challenges security consideration.
origin: StringThis member contains the fully qualified origin of the requester, as provided to the authenticator by the client, in the syntax defined by RFC6454.
cross_origin: Option<bool>This OPTIONAL member contains the inverse of the sameOriginWithAncestors argument value that was passed into the internal method
extra_data: ECollectedClientData can be extended by the user of this library, this accounts for keys that are unknown to the library, but may be known to the user.
unknown_keys: IndexMap<String, Value>CollectedClientData can be extended in the future, this accounts for unknown keys Uses an IndexMap to preserve order of keys for JSON byte serialization
Trait Implementations§
Source§impl<E> Clone for CollectedClientData<E>
impl<E> Clone for CollectedClientData<E>
Source§fn clone(&self) -> CollectedClientData<E>
fn clone(&self) -> CollectedClientData<E>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more