[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
This commit is contained in:
parent
a5a12a6723
commit
5d88fabe47
|
@ -19,7 +19,7 @@
|
||||||
<div>
|
<div>
|
||||||
<b class="fingerprint-phrase-header">{{ "fingerprintPhraseHeader" | i18n }}</b>
|
<b class="fingerprint-phrase-header">{{ "fingerprintPhraseHeader" | i18n }}</b>
|
||||||
<p class="fingerprint-text">
|
<p class="fingerprint-text">
|
||||||
<code>{{ passwordlessRequest?.fingerprintPhrase }}</code>
|
<code>{{ fingerprintPhrase }}</code>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
|
|
||||||
<div class="fingerprint section">
|
<div class="fingerprint section">
|
||||||
<h4>{{ "fingerprintPhraseHeader" | i18n }}</h4>
|
<h4>{{ "fingerprintPhraseHeader" | i18n }}</h4>
|
||||||
<code>{{ passwordlessRequest?.fingerprintPhrase }}</code>
|
<code>{{ fingerprintPhrase }}</code>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="section" *ngIf="showResendNotification">
|
<div class="section" *ngIf="showResendNotification">
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
<div class="tw-mb-6">
|
<div class="tw-mb-6">
|
||||||
<h4 class="tw-font-semibold">{{ "fingerprintPhraseHeader" | i18n }}</h4>
|
<h4 class="tw-font-semibold">{{ "fingerprintPhraseHeader" | i18n }}</h4>
|
||||||
<p>
|
<p>
|
||||||
<code>{{ passwordlessRequest?.fingerprintPhrase }}</code>
|
<code>{{ fingerprintPhrase }}</code>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,7 @@ export class LoginWithDeviceComponent
|
||||||
email: string;
|
email: string;
|
||||||
showResendNotification = false;
|
showResendNotification = false;
|
||||||
passwordlessRequest: PasswordlessCreateAuthRequest;
|
passwordlessRequest: PasswordlessCreateAuthRequest;
|
||||||
|
fingerprintPhrase: string;
|
||||||
onSuccessfulLoginTwoFactorNavigate: () => Promise<any>;
|
onSuccessfulLoginTwoFactorNavigate: () => Promise<any>;
|
||||||
onSuccessfulLogin: () => Promise<any>;
|
onSuccessfulLogin: () => Promise<any>;
|
||||||
onSuccessfulLoginNavigate: () => Promise<any>;
|
onSuccessfulLoginNavigate: () => Promise<any>;
|
||||||
|
@ -170,20 +171,20 @@ export class LoginWithDeviceComponent
|
||||||
|
|
||||||
private async buildAuthRequest() {
|
private async buildAuthRequest() {
|
||||||
this.authRequestKeyPair = await this.cryptoFunctionService.rsaGenerateKeyPair(2048);
|
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 deviceIdentifier = await this.appIdService.getAppId();
|
||||||
const publicKey = Utils.fromBufferToB64(this.authRequestKeyPair[0]);
|
const publicKey = Utils.fromBufferToB64(this.authRequestKeyPair[0]);
|
||||||
const accessCode = await this.passwordGenerationService.generatePassword({ length: 25 });
|
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.passwordlessRequest = new PasswordlessCreateAuthRequest(
|
||||||
this.email,
|
this.email,
|
||||||
deviceIdentifier,
|
deviceIdentifier,
|
||||||
publicKey,
|
publicKey,
|
||||||
AuthRequestType.AuthenticateAndUnlock,
|
AuthRequestType.AuthenticateAndUnlock,
|
||||||
accessCode,
|
accessCode
|
||||||
fingerprint
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,6 @@ export class PasswordlessCreateAuthRequest {
|
||||||
readonly deviceIdentifier: string,
|
readonly deviceIdentifier: string,
|
||||||
readonly publicKey: string,
|
readonly publicKey: string,
|
||||||
readonly type: AuthRequestType,
|
readonly type: AuthRequestType,
|
||||||
readonly accessCode: string,
|
readonly accessCode: string
|
||||||
readonly fingerprintPhrase: string
|
|
||||||
) {}
|
) {}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue