POST /mfa/totp/devices

为用户注册一个新的TOTP设备,生成独立的密钥和二维码,支持多设备管理。参考:RFC 6238 (TOTP)、OWASP ASVS V2.8.3。

多因素认证 `bearerAuth` application/json

请求体

Schema: service-mfa/internal/handler/dto.TOTPDeviceRegisterRequest

字段类型必填示例约束描述
device_name string 是 iPhone 15
account string 否 user@example.com
device_fingerprint string 否 fp-abc123

响应

引用的 Schema

service-core/base/dto.SimpleResponse

字段类型必填示例约束描述
code integer 否
message string 否
timestamp string 否

service-mfa/internal/handler/dto.TOTPDeviceRegisterDetailResponse

字段类型必填示例约束描述
code integer 否
data service-mfa/internal/handler/dto.TOTPDeviceRegisterResponse 否
message string 否
timestamp string 否

service-mfa/internal/handler/dto.TOTPDeviceRegisterResponse

字段类型必填示例约束描述
device_id string 否 dev-abc123
device_name string 否 iPhone 15
qr_code string 否 data:image/png;base64,...
qr_code_url string 否 otpauth://totp/...
secret string 否 JBSWY3DPEHPK3PXP