From 424d918ef4b61d38f96fa16a125ea49df3368e1c Mon Sep 17 00:00:00 2001 From: Scott Trinh Date: Mon, 4 Mar 2024 11:14:10 -0500 Subject: [PATCH 1/2] Explicitly pass expected properties --- .../protocol/auth_ext/_static/webauthn-authenticate.js | 6 ++++-- edb/server/protocol/auth_ext/_static/webauthn-register.js | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/edb/server/protocol/auth_ext/_static/webauthn-authenticate.js b/edb/server/protocol/auth_ext/_static/webauthn-authenticate.js index ffd226b20d..982a14c583 100644 --- a/edb/server/protocol/auth_ext/_static/webauthn-authenticate.js +++ b/edb/server/protocol/auth_ext/_static/webauthn-authenticate.js @@ -150,10 +150,12 @@ async function authenticateAssertion(props) { // Assertion includes raw bytes, so need to be encoded as base64url // for transmission const encodedAssertion = { - ...props.assertion, + type: props.assertion.type, + id: props.assertion.id, + authenticatorAttachments: props.assertion.authenticatorAttachment, + clientExtensionResults: props.assertion.getClientExtensionResults(), rawId: encodeBase64Url(new Uint8Array(props.assertion.rawId)), response: { - ...props.assertion.response, authenticatorData: encodeBase64Url( new Uint8Array(props.assertion.response.authenticatorData) ), diff --git a/edb/server/protocol/auth_ext/_static/webauthn-register.js b/edb/server/protocol/auth_ext/_static/webauthn-register.js index 1d5f7793d0..72c4fbcda6 100644 --- a/edb/server/protocol/auth_ext/_static/webauthn-register.js +++ b/edb/server/protocol/auth_ext/_static/webauthn-register.js @@ -164,10 +164,12 @@ async function registerCredentials(props) { // Credentials include raw bytes, so need to be encoded as base64url // for transmission const encodedCredentials = { - ...props.credentials, + type: props.credentials.type, + authenticatorAttachment: props.credentials.authenticatorAttachment, + clientExtensionResults: props.credentials.getClientExtensionResults(), + id: props.credentials.id, rawId: encodeBase64Url(new Uint8Array(props.credentials.rawId)), response: { - ...props.credentials.response, attestationObject: encodeBase64Url( new Uint8Array(props.credentials.response.attestationObject) ), From eaa7f8f9b4a5e6173568cd313bc13ab4e624e681 Mon Sep 17 00:00:00 2001 From: Scott Trinh Date: Tue, 5 Mar 2024 09:26:09 -0500 Subject: [PATCH 2/2] Fix typo --- edb/server/protocol/auth_ext/_static/webauthn-authenticate.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/edb/server/protocol/auth_ext/_static/webauthn-authenticate.js b/edb/server/protocol/auth_ext/_static/webauthn-authenticate.js index 982a14c583..787afcd385 100644 --- a/edb/server/protocol/auth_ext/_static/webauthn-authenticate.js +++ b/edb/server/protocol/auth_ext/_static/webauthn-authenticate.js @@ -152,7 +152,7 @@ async function authenticateAssertion(props) { const encodedAssertion = { type: props.assertion.type, id: props.assertion.id, - authenticatorAttachments: props.assertion.authenticatorAttachment, + authenticatorAttachment: props.assertion.authenticatorAttachment, clientExtensionResults: props.assertion.getClientExtensionResults(), rawId: encodeBase64Url(new Uint8Array(props.assertion.rawId)), response: {