You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: store latest challenge/attestation data (#2179)
## What kind of change does this PR introduce?
Feature - Store WebAuthn challenge data for customer verification
purposes
## What is the current behavior?
Currently, WebAuthn challenge data (attestation/assertion responses) is
not persisted after verification, making it impossible for customers to
review or audit the WebAuthn authentication details.
## What is the new behavior?
- Added `last_webauthn_challenge_data` JSONB column to `mfa_factors`
table to store the latest challenge verification data
- The system now stores the challenge, type (create/request), and parsed
credential response after successful WebAuthn verification, THEN deletes
the challenge like before.
## Additional context
The structure for the JSONb would be like so, based on whether it's a
`create` or `request` webauthn operation
```typescript
type LastWebAuthnChallengeData = {
challenge: ChallengeData,
} & {
type: "create"
credential_response: ParsedCredentialCreationData
} | {
type: "request"
credential_response: ParsedCredentialAssertionData
}
```
---------
Co-authored-by: Stojan Dimitrovski <[email protected]>
ALTERTABLE {{ index .Options "Namespace" }}.mfa_factors
2
+
ADD COLUMN IF NOT EXISTS last_webauthn_challenge_data JSONB;
3
+
4
+
COMMENT ON COLUMN {{ index .Options "Namespace" }}.mfa_factors.last_webauthn_challenge_data IS 'Stores the latest WebAuthn challenge data including attestation/assertion for customer verification';
0 commit comments