Skip to content

Commit

Permalink
Update files/en-us/web/api/publickeycredential/parserequestoptionsfro…
Browse files Browse the repository at this point in the history
…mjson_static/index.md

Co-authored-by: Hamish Willee <[email protected]>
  • Loading branch information
wbamberg and hamishwillee authored Aug 5, 2024
1 parent b29ccab commit ca95dbf
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ The Web Authentication process for [authenticating a (registered) user](/en-US/d
The web app passes this information to an authenticator to find the credential, by calling [`navigator.credentials.get()`](/en-US/docs/Web/API/CredentialsContainer/get) with an argument that contains the server-supplied data as a {{domxref("PublicKeyCredentialRequestOptions")}} instance

The specification does not define how the information needed for requesting a credential is sent.
A convenient approach is for the server to encapsulate the information in a {{glossary("JSON type representation")}} of the a {{domxref("PublicKeyCredentialRequestOptions")}} instance, that mirrors its structure but encodes buffer properties such as the `challenge` as [base64url](/en-US/docs/Glossary/Base64) strings.
A convenient approach is for the server to encapsulate the information in a {{glossary("JSON type representation")}} of a {{domxref("PublicKeyCredentialRequestOptions")}} instance, that mirrors its structure but encodes buffer properties such as the `challenge` as [base64url](/en-US/docs/Glossary/Base64) strings.
This object can be serialized to a [JSON](/en-US/docs/Glossary/JSON) string, sent to the web app and deserialized, and then converted to a {{domxref("PublicKeyCredentialRequestOptions")}} instance using **`parseRequestOptionsFromJSON()`**.

## Examples
Expand Down

0 comments on commit ca95dbf

Please sign in to comment.