fix(auth): store passkey backup flags so synced passkeys verify
go-webauthn refuses an assertion whose Backup Eligible flag differs from the stored credential's. The flag was never stored, so it compared against false and every synced passkey (iCloud Keychain, Google Password Manager, 1Password) failed with "Backup Eligible flag inconsistency" - in passwordless sign-in, second-factor sign-in and step-up alike. Registration now stores BackupEligible and BackupState. Rows registered before this have no baseline, so their first verified assertion adopts the signed flag and records it; a recorded value always stands, so a genuine change is still refused.
This commit is contained in:
@@ -55,6 +55,14 @@ type WebAuthnCredential struct {
|
||||
AAGUID []byte `bson:"aaguid" json:"-"`
|
||||
Transports []string `bson:"transports,omitempty" json:"transports,omitempty"`
|
||||
|
||||
// BackupEligible is whether the credential can sync between devices. It
|
||||
// never changes for a real credential, and go-webauthn refuses an assertion
|
||||
// whose flag differs from this one, so it must be stored. Nil only on rows
|
||||
// registered before it was recorded; see auth.backupEligibleFor.
|
||||
BackupEligible *bool `bson:"backup_eligible,omitempty" json:"-"`
|
||||
// BackupState is whether it is currently synced. It may change.
|
||||
BackupState bool `bson:"backup_state" json:"-"`
|
||||
|
||||
// CredentialIDHex is the browser-facing identifier for rename and delete.
|
||||
// The raw bytes never reach a URL.
|
||||
CredentialIDHex string `bson:"credential_id_hex" json:"id"`
|
||||
|
||||
Reference in New Issue
Block a user