Skip to content
bitzorcas
EN

Concept

双因素认证

计划中的基于 TOTP 的双因素认证 — 认证器应用集成、QR 码配置和恢复代码。

Last updated

双因素认证(2FA/TOTP)在 BitzOrcas 中尚未实现。计划作为认证系统的增强。

计划实现

流程

用户名 + 密码登录
已启用 2FA?→ 否 → 签发 JWT → 完成
输入认证器应用中的 TOTP 码
验证 TOTP → 签发 JWT → 完成

TOTP 验证

// 计划中:基于时间的 OTP 验证
public interface ITotpVerifier
{
bool VerifyCode(string secret, string code);
string GenerateSecret();
string GenerateQrCodeUri(string email, string secret);
}

恢复代码

当认证器不可用时的单次恢复代码,用于账户恢复。

配置(计划中)

{
"TwoFactor": {
"Enabled": true,
"Issuer": "BitzOrcas Platform",
"CodeLength": 6,
"CodeValiditySeconds": 30
}
}

另见

  • 认证 — 当前 JWT/HMAC/API Key 系统