Skip to content

[Feature] YubiKey OTP #198

@KiritoXDone

Description

@KiritoXDone

Pre-check / 提交前确认

  • I have searched existing issues and this request is not duplicated. / 我已搜索现有 issue,确认不是重复建议。

Problem Statement / 现存问题

佬, 能支持下 yubikey otp 吗

Proposed Solution / 建议方案

参考 https://github.com/dani-garcia/vaultwarden/blob/main/src/api/core/two_factor/yubikey.rs
Codex 总结: 按 Vaultwarden 的 yubikey.rs 做等价实现:新增 get-yubikey 与 yubikey(POST/PUT)接口,用户侧存 keys(OTP前12位) + nfc,开启时允许提交 12 位 key id 或 44 位 OTP(44 位需先在线验真再截前12位入库),登录时强制 44 位 OTP 且其前12位必须命中已绑定 keys,再调用 Yubico 校验;同时必须具备完整安全能力(YUBICO_CLIENT_ID/SECRET 必填校验、Yubico 返回签名 h 验证、nonce 一致性与防重放、接口限流、审计日志、统一错误避免枚举),并在启用后复用现有恢复码流程。

Alternatives Considered / 备选方案

No response

Expected Impact / 预期价值

支持更多 2fa 功能

Scope (Optional) / 影响范围(可选)

No response

Additional Context / 补充信息

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions