From 5d88fabe47f9b1198655bf96af02b77dfe4e6975 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bispo?= Date: Thu, 23 Mar 2023 11:02:51 +0000 Subject: [PATCH] [PM-107][PM-130] Remove fingerprint from request (#4910) * [PM-108] Fingerprint is calculated based on pubKey * [PM-108] Change userId to userEmail. Remove fingerprint from AuthResponse * [PM-130][PM-107] Remove fingerprint from request and clients UI --- .../src/auth/popup/login-with-device.component.html | 2 +- .../src/auth/login/login-with-device.component.html | 2 +- .../src/auth/login/login-with-device.component.html | 2 +- .../auth/components/login-with-device.component.ts | 11 ++++++----- .../request/passwordless-create-auth.request.ts | 3 +-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/apps/browser/src/auth/popup/login-with-device.component.html b/apps/browser/src/auth/popup/login-with-device.component.html index cb2a248170..d794b7d212 100644 --- a/apps/browser/src/auth/popup/login-with-device.component.html +++ b/apps/browser/src/auth/popup/login-with-device.component.html @@ -19,7 +19,7 @@
{{ "fingerprintPhraseHeader" | i18n }}

- {{ passwordlessRequest?.fingerprintPhrase }} + {{ fingerprintPhrase }}

diff --git a/apps/desktop/src/auth/login/login-with-device.component.html b/apps/desktop/src/auth/login/login-with-device.component.html index c69a974d6d..a1fcb42400 100644 --- a/apps/desktop/src/auth/login/login-with-device.component.html +++ b/apps/desktop/src/auth/login/login-with-device.component.html @@ -27,7 +27,7 @@

{{ "fingerprintPhraseHeader" | i18n }}

- {{ passwordlessRequest?.fingerprintPhrase }} + {{ fingerprintPhrase }}
diff --git a/apps/web/src/auth/login/login-with-device.component.html b/apps/web/src/auth/login/login-with-device.component.html index 84598b11ff..f7cad80893 100644 --- a/apps/web/src/auth/login/login-with-device.component.html +++ b/apps/web/src/auth/login/login-with-device.component.html @@ -25,7 +25,7 @@

{{ "fingerprintPhraseHeader" | i18n }}

- {{ passwordlessRequest?.fingerprintPhrase }} + {{ fingerprintPhrase }}

diff --git a/libs/angular/src/auth/components/login-with-device.component.ts b/libs/angular/src/auth/components/login-with-device.component.ts index 61aaec1dd8..5bf520cab6 100644 --- a/libs/angular/src/auth/components/login-with-device.component.ts +++ b/libs/angular/src/auth/components/login-with-device.component.ts @@ -35,6 +35,7 @@ export class LoginWithDeviceComponent email: string; showResendNotification = false; passwordlessRequest: PasswordlessCreateAuthRequest; + fingerprintPhrase: string; onSuccessfulLoginTwoFactorNavigate: () => Promise; onSuccessfulLogin: () => Promise; onSuccessfulLoginNavigate: () => Promise; @@ -170,20 +171,20 @@ export class LoginWithDeviceComponent private async buildAuthRequest() { this.authRequestKeyPair = await this.cryptoFunctionService.rsaGenerateKeyPair(2048); - const fingerprint = await ( - await this.cryptoService.getFingerprint(this.email, this.authRequestKeyPair[0]) - ).join("-"); const deviceIdentifier = await this.appIdService.getAppId(); const publicKey = Utils.fromBufferToB64(this.authRequestKeyPair[0]); const accessCode = await this.passwordGenerationService.generatePassword({ length: 25 }); + this.fingerprintPhrase = ( + await this.cryptoService.getFingerprint(this.email, this.authRequestKeyPair[0]) + ).join("-"); + this.passwordlessRequest = new PasswordlessCreateAuthRequest( this.email, deviceIdentifier, publicKey, AuthRequestType.AuthenticateAndUnlock, - accessCode, - fingerprint + accessCode ); } diff --git a/libs/common/src/auth/models/request/passwordless-create-auth.request.ts b/libs/common/src/auth/models/request/passwordless-create-auth.request.ts index cb85f823c2..865dd43dc6 100644 --- a/libs/common/src/auth/models/request/passwordless-create-auth.request.ts +++ b/libs/common/src/auth/models/request/passwordless-create-auth.request.ts @@ -6,7 +6,6 @@ export class PasswordlessCreateAuthRequest { readonly deviceIdentifier: string, readonly publicKey: string, readonly type: AuthRequestType, - readonly accessCode: string, - readonly fingerprintPhrase: string + readonly accessCode: string ) {} }