Skip to content

fix(webauthn): fix webauthn key option during registration to impl discoverable key#2451

Open
EzraRT wants to merge 1 commit intoOpenListTeam:mainfrom
EzraRT:main
Open

fix(webauthn): fix webauthn key option during registration to impl discoverable key#2451
EzraRT wants to merge 1 commit intoOpenListTeam:mainfrom
EzraRT:main

Conversation

@EzraRT
Copy link
Copy Markdown
Contributor

@EzraRT EzraRT commented May 7, 2026

Description / 描述

一句话:现在使用通行密钥登录时,不用提前输入用户名了。
修复 WebAuthn 注册流程中的 key option 配置,注册时显式要求使用 discoverable key(resident key)。

Motivation and Context / 背景

当前注册流程中未明确要求 discoverable key,可能导致部分依赖该能力的 WebAuthn 注册/认证场景行为不符合预期。
这次修改通过在注册阶段增加 ResidentKeyRequirementRequired 配置,使注册结果更符合 discoverable key 的预期使用方式

修改前:不提前输入用户名,密码管理器不会罗列该站点的通行密钥
ScreenShot 2026-05-07 at 16 45 18@2x

修改后:不提前输入用户名,密码管理器可以正常罗列该站点的所有通行密钥
ScreenShot 2026-05-07 at 16 47 12@2x

How Has This Been Tested? / 测试

基于本次提交内容进行了代码层面的检查,确认:

  • 本次改动范围集中在 server/handles/webauthn.go,未引入额外接口变更。
  • 已验证 WebAuthn 注册流程可正常返回注册参数; { "authenticatorSelection": { "requireResidentKey": true, "residentKey": "required" } }
  • 已验证登录流程,在不传username参数时,客户端可发现该站点所有通行密钥,服务端接收请求时可正常从通行密钥中解析出用户并完成登录流程;

Checklist / 检查清单

  • I have read the CONTRIBUTING document.
    我已阅读 CONTRIBUTING 文档。
  • I have formatted my code with go fmt or prettier.
    我已使用 go fmtprettier 格式化提交的代码。
  • I have added appropriate labels to this PR (or mentioned needed labels in the description if lacking permissions).
    我已为此 PR 添加了适当的标签(如无权限或需要的标签不存在,请在描述中说明,管理员将后续处理)。
  • I have requested review from relevant code authors using the "Request review" feature when applicable.
    我已在适当情况下使用"Request review"功能请求相关代码作者进行审查。
  • I have updated the repository accordingly (If it’s needed).

@EzraRT
Copy link
Copy Markdown
Contributor Author

EzraRT commented May 7, 2026

@jyxjjj Hi,可以帮我指定一位 Reviewer 吗

@jyxjjj
Copy link
Copy Markdown
Member

jyxjjj commented May 7, 2026

用户已经创建过密钥的,是否需要迁移流程呢?

@EzraRT
Copy link
Copy Markdown
Contributor Author

EzraRT commented May 7, 2026

用户已经创建过密钥的,是否需要迁移流程呢?

之前创建的,不输入用户名无法显示,输入用户名后仍可显示,不影响旧流程。

@jyxjjj
Copy link
Copy Markdown
Member

jyxjjj commented May 7, 2026

#2161
目前没有审核人员 我看你改的是没问题的 但是 #2161 那边有整个迁移到 Passkey
目前来说 你的这个PR可以直接合并 但是 #2161 没人审核

@EzraRT
Copy link
Copy Markdown
Contributor Author

EzraRT commented May 7, 2026

看起来 #2161 也修改了这一行,先合入这个应该不会导致冲突。其余部分待其他人有空审查再合入吧。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants