From 1921a1b276544efea4c85c775078e5623877e41b Mon Sep 17 00:00:00 2001 From: octavien-mural Date: Fri, 15 Sep 2023 17:31:59 -0400 Subject: [PATCH 1/4] update demo --- examples/with-federated-passkeys/src/pages/index.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/examples/with-federated-passkeys/src/pages/index.tsx b/examples/with-federated-passkeys/src/pages/index.tsx index 8b41bed70..65f90ba16 100644 --- a/examples/with-federated-passkeys/src/pages/index.tsx +++ b/examples/with-federated-passkeys/src/pages/index.tsx @@ -21,8 +21,9 @@ type privateKeyResult = { }; // All algorithms can be found here: https://www.iana.org/assignments/cose/cose.xhtml#algorithms -// We only support ES256, which is listed here +// We only support ES256 and RS256, which are listed here const es256 = -7; +const rs256 = -257; // This constant designates the type of credential we want to create. // The enum only supports one value, "public-key" @@ -112,6 +113,11 @@ export default function Home() { // https://www.w3.org/TR/webauthn-2/#sctn-sample-registration const attestation = await getWebAuthnAttestation({ publicKey: { + authenticatorSelection: { + residentKey: "preferred", + requireResidentKey: false, + userVerification: "preferred" + }, rp: { id: "localhost", name: "Turnkey Federated Passkey Demo", @@ -122,6 +128,10 @@ export default function Home() { type: publicKey, alg: es256, }, + { + type: publicKey, + alg: rs256, + } ], user: { id: authenticatorUserId, From 121e333d756a08ab10a52b1ed3d380e4cd047db5 Mon Sep 17 00:00:00 2001 From: octavien-mural Date: Fri, 15 Sep 2023 17:46:21 -0400 Subject: [PATCH 2/4] add trailing comma --- examples/with-federated-passkeys/src/pages/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/with-federated-passkeys/src/pages/index.tsx b/examples/with-federated-passkeys/src/pages/index.tsx index 65f90ba16..fe6569113 100644 --- a/examples/with-federated-passkeys/src/pages/index.tsx +++ b/examples/with-federated-passkeys/src/pages/index.tsx @@ -131,7 +131,7 @@ export default function Home() { { type: publicKey, alg: rs256, - } + }, ], user: { id: authenticatorUserId, From f355bd52e1ea6c9110b653ecdc96780247b36c11 Mon Sep 17 00:00:00 2001 From: octavien-mural Date: Mon, 18 Sep 2023 16:13:41 -0400 Subject: [PATCH 3/4] add trailing comma --- examples/with-federated-passkeys/src/pages/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/with-federated-passkeys/src/pages/index.tsx b/examples/with-federated-passkeys/src/pages/index.tsx index fe6569113..922a002f9 100644 --- a/examples/with-federated-passkeys/src/pages/index.tsx +++ b/examples/with-federated-passkeys/src/pages/index.tsx @@ -116,7 +116,7 @@ export default function Home() { authenticatorSelection: { residentKey: "preferred", requireResidentKey: false, - userVerification: "preferred" + userVerification: "preferred", }, rp: { id: "localhost", From 8a2ff2e4e78ec01d0ad28c847b76a3bf1901aa43 Mon Sep 17 00:00:00 2001 From: octavien-mural Date: Mon, 18 Sep 2023 18:13:39 -0400 Subject: [PATCH 4/4] prettify --- examples/with-federated-passkeys/src/pages/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/with-federated-passkeys/src/pages/index.tsx b/examples/with-federated-passkeys/src/pages/index.tsx index 922a002f9..781fff40b 100644 --- a/examples/with-federated-passkeys/src/pages/index.tsx +++ b/examples/with-federated-passkeys/src/pages/index.tsx @@ -113,7 +113,7 @@ export default function Home() { // https://www.w3.org/TR/webauthn-2/#sctn-sample-registration const attestation = await getWebAuthnAttestation({ publicKey: { - authenticatorSelection: { + authenticatorSelection: { residentKey: "preferred", requireResidentKey: false, userVerification: "preferred",