POST /mfa/totp/enable
为用户启用基于时间的一次性密码(TOTP)认证,生成密钥和二维码,返回备用恢复码。参考:RFC 6238 (TOTP)、OWASP ASVS V2.8.3。
多因素认证 `bearerAuth` application/json
引用的 Schema
service-core/base/dto.SimpleResponse
| 字段 | 类型 | 必填 | 示例 | 约束 | 描述 |
code |
integer |
否 |
|
|
|
message |
string |
否 |
|
|
|
timestamp |
string |
否 |
|
|
|
service-mfa/internal/handler/dto.TOTPEnableDetailResponse
service-mfa/internal/handler/dto.TOTPEnableResponse
| 字段 | 类型 | 必填 | 示例 | 约束 | 描述 |
backup_codes |
array of
string |
否 |
['["12345678"', '"23456789"]'] |
|
|
qr_code |
string |
否 |
data:image/png;base64,iVBORw0KGgo... |
|
|
qr_code_url |
string |
否 |
otpauth://totp/Autional:user@example.com?secret=JBSWY3DPEHPK3PXP&issuer=Autional |
|
|
secret |
string |
否 |
JBSWY3DPEHPK3PXP |
|
|
setup_url |
string |
否 |
https://auth.example.com/mfa/totp/setup |
|
|