diff options
author | Matthew Miller <matthew@millerti.me> | 2023-07-27 08:42:05 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-27 08:42:05 -0700 |
commit | f30a195ab1c5b7476fb8056e6ac25a13a7546452 (patch) | |
tree | c2779d080e51bea1463effd581752cd245b9940a /packages/server/src/authentication/verifyAuthenticationResponse.ts | |
parent | 5731c7d0427323bbd78df195295c28eb39f822ba (diff) | |
parent | 22ca0cd6dab119a28794dbaa33d650f97ab107a1 (diff) |
Merge pull request #415 from Mikescops/feature/add-origin-authentication-registration-info
Add origin and rpID in authentication and registration info
Diffstat (limited to 'packages/server/src/authentication/verifyAuthenticationResponse.ts')
-rw-r--r-- | packages/server/src/authentication/verifyAuthenticationResponse.ts | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/packages/server/src/authentication/verifyAuthenticationResponse.ts b/packages/server/src/authentication/verifyAuthenticationResponse.ts index d95bca5..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; @@ -215,6 +215,8 @@ export async function verifyAuthenticationResponse( credentialDeviceType, credentialBackedUp, authenticatorExtensionResults: extensionsData, + origin: clientDataJSON.origin, + rpID: matchedRPID, }, }; @@ -236,6 +238,8 @@ export async function verifyAuthenticationResponse( * @param authenticationInfo.credentialBackedUp Whether or not the multi-device credential has been * 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 */ @@ -247,6 +251,8 @@ export type VerifiedAuthenticationResponse = { userVerified: boolean; credentialDeviceType: CredentialDeviceType; credentialBackedUp: boolean; + origin: string; + rpID: string; authenticatorExtensionResults?: AuthenticationExtensionsAuthenticatorOutputs; }; }; |