From 158d1fbe01148ab6d2116041973f3c532c109695 Mon Sep 17 00:00:00 2001 From: Andreas Coroiu Date: Fri, 10 Feb 2023 15:52:46 +0100 Subject: [PATCH] [EC-598] feat: add timeout and UV to params --- apps/browser/src/browser/webauthn-utils.ts | 3 +++ .../src/webauthn/abstractions/fido2.service.abstraction.ts | 3 +++ 2 files changed, 6 insertions(+) diff --git a/apps/browser/src/browser/webauthn-utils.ts b/apps/browser/src/browser/webauthn-utils.ts index 88471eefbea..a4ad7a14954 100644 --- a/apps/browser/src/browser/webauthn-utils.ts +++ b/apps/browser/src/browser/webauthn-utils.ts @@ -73,6 +73,7 @@ export class WebauthnUtils { id: Fido2Utils.bufferToString(keyOptions.user.id), displayName: keyOptions.user.displayName, }, + timeout: keyOptions.timeout, }; } @@ -105,6 +106,8 @@ export class WebauthnUtils { keyOptions.allowCredentials?.map((c) => Fido2Utils.bufferToString(c.id)) ?? [], challenge: Fido2Utils.bufferToString(keyOptions.challenge), rpId: keyOptions.rpId, + userVerification: keyOptions.userVerification, + timeout: keyOptions.timeout, }; } diff --git a/libs/common/src/webauthn/abstractions/fido2.service.abstraction.ts b/libs/common/src/webauthn/abstractions/fido2.service.abstraction.ts index da6b75a8415..835ddfef1d6 100644 --- a/libs/common/src/webauthn/abstractions/fido2.service.abstraction.ts +++ b/libs/common/src/webauthn/abstractions/fido2.service.abstraction.ts @@ -31,6 +31,7 @@ export interface CredentialRegistrationParams { id: string; // b64 encoded displayName: string; }; + timeout: number; } export interface CredentialRegistrationResult { @@ -47,6 +48,8 @@ export interface CredentialAssertParams { rpId: string; origin: string; challenge: string; + userVerification?: "discouraged" | "preferred" | "required"; + timeout: number; } export interface CredentialAssertResult {