Client Data
The Client Data object is used during user registration, new credential creation, login, recovery and action signingFido2 credential
When using Fido2, theclient data
object is built inside the authenticator and returned to the browser base64url
encoded. There is no need to modify it.
More information can be found in the W3C webauthn offical specification
field | type | description |
---|---|---|
type | string | webauthn.create for registration and new credentialwebauthn.get for login and action signing |
challenge | string | The challenge returned from the init call |
origin | string | The origin in which the app is being executed |
crossOrigin | boolean | A flag indicating if the current call is running cross origin; in most cases this should be false |
Example
Key, Password Protected Key and Recovery credential
Unlike when usingFido2 credential
, the client data object needs to be created manually for Key credential
. Once created the object needs to be “stringified” and base64url encoded.
field | type | description |
---|---|---|
type | string | key.create for registration and new credentialkey.get for login and action signing |
challenge | string | The challenge returned from the init call. The challenge is already base64url encoded, there is no need to encode it |
Example
Attestation Data
This attestation data object is used during registration and new credential.Fido2 credential
When using Fido2, theattestation data
object is built inside the authenticator and returned to the browser. It is encoded using CBOR specification. There is no need to modify it.
More information can be found in the W3C webauthn offical specification.
It is an opaque object and there is no need to describe it here.
Example
Key, Password Protected Key and Recovery credential
Unlike when usingFido2 credential
, the attestation data object needs to be created manually for Key credential
. Once created the object needs to be “stringified” and base64url encoded.
Before building the attestation data
object, the credential info fingerprint
object needs to be created.
Credential Info Fingerprint
The attestation data object contains asignature
. This section explains how to construct the credential info fingerprint object that is then signed and included in the attestation data object.
Field | Type | Description |
---|---|---|
clientDataHash | string | The hex encoded SHA-256 hash of the “stringified” client data object |
publicKey | string | PEM encoded public key that can be used to verify the signature for the credential |
In order for the server to properly verify the signature, the The “stringified” version needs to be
clientDataHash
needs to be computed in a reproducible way. That means the “stringified” operation of the client data object needs to be done with the following requirements:- Keys need to be sorted in alphabetical order:
challenge
first, and thentype
- Separators need to be
:
and,
without any space before and after
attestation data
object is built with the following fields
Field | Type | Description |
---|---|---|
publicKey | string | PEM encoded public key that can be used to verify the signature for the credential. This the same public key than the one in the Credential Info Fingerprint object |
signature | string | The signature produced by signing the “stringified” Credential Info Fingerprint object with the credentials private key, using the algorithm specified in algorithm . Needs to be encoded as a hex string |
algorithm | string |
|
In order for the server to properly verify the signature, the “stringified” operation of the Credential Info Fingerprint object needs to be done with the following requirements:The “stringified” version needs to be
- Keys need to be sorted in alphabetical order:
clientDataHash
first, thenpublicKey
- Separators need to be
:
and,
without any space before and after
The signature also needs to be generated with pre-defined hash algorithm and encoding:
- Hash algorithm:
SHA256
- Encoding:
DER
. See Signature Format for more information