From b04c8fd6499ea2535d6a1f4c72fb5edb9636f45d Mon Sep 17 00:00:00 2001 From: Hamish Willee Date: Fri, 13 Oct 2023 14:50:35 +1100 Subject: [PATCH] Fix up top level --- files/en-us/web/api/publickeycredential/index.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/files/en-us/web/api/publickeycredential/index.md b/files/en-us/web/api/publickeycredential/index.md index d5e57c8b9623f84..207dc3e4c783568 100644 --- a/files/en-us/web/api/publickeycredential/index.md +++ b/files/en-us/web/api/publickeycredential/index.md @@ -37,9 +37,9 @@ The **`PublicKeyCredential`** interface provides information about a public key - {{domxref("PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable_static", "PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable()")}} {{securecontext_inline}} - : Returns a {{jsxref("Promise")}} which resolves to `true` if an authenticator bound to the platform is capable of _verifying_ the user. - {{domxref("PublicKeyCredential.parseCreationOptionsFromJSON_static", "PublicKeyCredential.parseCreationOptionsFromJSON()")}} {{experimental_inline}}{{securecontext_inline}} - - : Convenience method for deserializing server-sent credential registration data when [registering a user with credentials](/en-US/docs/Web/API/Web_Authentication_API#creating_a_key_pair_and_registering_a_user) (creating a [credential options object](/en-US/docs/Web/API/CredentialsContainer/create#publickey_object_structure) from a server-supplied JSON string). + - : Convenience method for deserializing server-sent credential registration data when [registering a user with credentials](/en-US/docs/Web/API/Web_Authentication_API#creating_a_key_pair_and_registering_a_user). - {{domxref("PublicKeyCredential.parseRequestOptionsFromJSON_static", "PublicKeyCredential.parseRequestOptionsFromJSON()")}} {{experimental_inline}}{{securecontext_inline}} - - : Convenience method for deserializing server-sent credential request data when [authenticating a (registered) user](/en-US/docs/Web/API/Web_Authentication_API#authenticating_a_user) (creating a [credential request options object](/en-US/docs/Web/API/CredentialsContainer/get#publickey_object_structure) from a server-supplied JSON string). + - : Convenience method for deserializing server-sent credential request data when [authenticating a (registered) user](/en-US/docs/Web/API/Web_Authentication_API#authenticating_a_user). ## Instance methods @@ -55,7 +55,7 @@ The **`PublicKeyCredential`** interface provides information about a public key Here, we use {{domxref("CredentialsContainer.create()","navigator.credentials.create()")}} to generate a new credential. ```js -const publicKey = { +const createCredentialOptions = { challenge: new Uint8Array([ 21, 31, 105 /* 29 more random bytes generated by the server */, ]), @@ -77,7 +77,7 @@ const publicKey = { }; navigator.credentials - .create({ publicKey }) + .create({ createCredentialOptions }) .then((newCredentialInfo) => { const response = newCredentialInfo.response; const clientExtensionsResults = @@ -93,14 +93,14 @@ navigator.credentials Here, we fetch an existing credential from an authenticator, using {{domxref("CredentialsContainer.get()","navigator.credentials.get()")}}. ```js -const options = { +const requestCredentialOptions = { challenge: new Uint8Array([ /* bytes sent from the server */ ]), }; navigator.credentials - .get({ publicKey: options }) + .get({ requestCredentialOptions }) .then((credentialInfoAssertion) => { // send assertion response back to the server // to proceed with the control of the credential