Path: blob/main/files/en-us/web/api/authenticatorresponse/clientdatajson/index.md
6547 views
------{{APIRef("Web Authentication API")}}{{securecontext_header}}
The clientDataJSON property of the {{domxref("AuthenticatorResponse")}} interface stores a JSON string in an {{jsxref("ArrayBuffer")}}, representing the client data that was passed to {{domxref("CredentialsContainer.create()")}} or {{domxref("CredentialsContainer.get()")}}. This property is only accessed on one of the child objects of AuthenticatorResponse, specifically {{domxref("AuthenticatorAttestationResponse")}} or {{domxref("AuthenticatorAssertionResponse")}}.
Value
An {{jsxref("ArrayBuffer")}}.
Instance properties
After the clientDataJSON object is converted from an ArrayBuffer to a JavaScript object, it will have the following properties:
type: A string which is either
"webauthn.get"when an existing credential is retrieved or"webauthn.create"when a new credential is created.
challenge: The base64url encoded version of the cryptographic challenge sent from the relying party's server. The original value are passed as the
challengeoption in {{domxref("CredentialsContainer.get()")}} or {{domxref("CredentialsContainer.create()")}}.
origin: The fully qualified origin of the requester which has been given by the client/browser to the authenticator. We should expect the relying party's id to be a suffix of this value.
tokenBindingId{{optional_inline}}: An object describing the state of the token binding protocol for the communication with the relying party. It has two properties:
status: A string which is either"supported"which indicates the client support token binding but did not negotiate with the relying party or"present"when token binding was used alreadyid: A string which is the base64url encoding of the token binding ID which was used for the communication.
Should this property be absent, it would indicate that the client does not support token binding.
Examples
Specifications
{{Specifications}}
Browser compatibility
{{Compat}}