Skip to content

Commit dcfefce

Browse files
authored
fix(webauthn): enable discoverable keys (#2451)
Set `WithResidentKeyRequirement` option during registration to enable discoverable keys. Existing keys do not require migration. They won't appear without entering username, but work normally after username input, legacy flows remain unaffected.
1 parent d349765 commit dcfefce

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

server/handles/webauthn.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,10 @@ func BeginAuthnRegistration(c *gin.Context) {
133133
return
134134
}
135135

136-
options, sessionData, err := authnInstance.BeginRegistration(user)
136+
options, sessionData, err := authnInstance.BeginRegistration(
137+
user,
138+
webauthn.WithResidentKeyRequirement(protocol.ResidentKeyRequirementRequired),
139+
)
137140

138141
if err != nil {
139142
common.ErrorResp(c, err, 400)

0 commit comments

Comments
 (0)