diff options
author | Corentin Mors <corentin@dashlane.com> | 2023-07-20 09:30:10 +0200 |
---|---|---|
committer | Corentin Mors <corentin@dashlane.com> | 2023-07-20 16:43:01 +0200 |
commit | 57f58b87892fe01ba62f78be1b9ac219decd854c (patch) | |
tree | 518533a748005bebe93f7d7d477ce61b655680ba /packages/server/src/authentication/verifyAuthenticationResponse.ts | |
parent | 79f89b85ba19429c2f4974bc012071aa6f542c55 (diff) |
Add matched RPID to verify response
Diffstat (limited to 'packages/server/src/authentication/verifyAuthenticationResponse.ts')
-rw-r--r-- | packages/server/src/authentication/verifyAuthenticationResponse.ts | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/packages/server/src/authentication/verifyAuthenticationResponse.ts b/packages/server/src/authentication/verifyAuthenticationResponse.ts index bfc5bf5..c9f23ca 100644 --- a/packages/server/src/authentication/verifyAuthenticationResponse.ts +++ b/packages/server/src/authentication/verifyAuthenticationResponse.ts @@ -154,7 +154,7 @@ export async function verifyAuthenticationResponse( expectedRPIDs = expectedRPID; } - await matchExpectedRPID(rpIdHash, expectedRPIDs); + const matchedRPID = await matchExpectedRPID(rpIdHash, expectedRPIDs); if (advancedFIDOConfig !== undefined) { const { userVerification: fidoUserVerification } = advancedFIDOConfig; @@ -216,6 +216,7 @@ export async function verifyAuthenticationResponse( credentialBackedUp, authenticatorExtensionResults: extensionsData, origin: clientDataJSON.origin, + rpID: matchedRPID, }, }; @@ -238,6 +239,7 @@ export async function verifyAuthenticationResponse( * backed up. Always `false` for single-device credentials. **Should be kept in a DB for later * reference!** * @param authenticationInfo.origin The origin of the website that the authentication occurred on + * @param authenticationInfo.rpID The RP ID that the authentication occurred on * @param authenticationInfo?.authenticatorExtensionResults The authenticator extensions returned * by the browser */ @@ -250,6 +252,7 @@ export type VerifiedAuthenticationResponse = { credentialDeviceType: CredentialDeviceType; credentialBackedUp: boolean; origin: string; + rpID: string; authenticatorExtensionResults?: AuthenticationExtensionsAuthenticatorOutputs; }; }; |