A AuthMS API Wiki API Reference iam.tianv.com →

POST /mfa/totp/setup

为用户启用基于时间的一次性密码(TOTP)认证,生成密钥和二维码,返回备用恢复码。参考:RFC 6238 (TOTP)、OWASP ASVS V2.8.3。

MFA `bearerAuth` application/json

Request Body

Schema: dto.TOTPEnableRequest

FieldTypeRequiredExampleConstraintsDescription
account string No
device_name string No

Responses

StatusDescriptionSchema
200TOTP配置信息,包含密钥URL和二维码dto.TOTPEnableDetailResponse
400参数错误或TOTP已启用gitee_com_linmes_authms_base_dto.SimpleResponse
401未认证gitee_com_linmes_authms_base_dto.SimpleResponse
500服务器内部错误gitee_com_linmes_authms_base_dto.SimpleResponse

Referenced Schemas

dto.TOTPEnableDetailResponse

FieldTypeRequiredExampleConstraintsDescription
code integer No
data dto.TOTPEnableResponse No
message string No
timestamp string No

dto.TOTPEnableResponse

FieldTypeRequiredExampleConstraintsDescription
backup_codes array of

string

No ['["12345678"', '"23456789"]']
qr_code string No data:image/png;base64,iVBORw0KGgo...
qr_code_url string No otpauth://totp/AuthMS:user@example.com?secret=JBSWY3DPEHPK3PXP&issuer=AuthMS
secret string No JBSWY3DPEHPK3PXP
setup_url string No https://auth.example.com/mfa/totp/setup

gitee_com_linmes_authms_base_dto.SimpleResponse

FieldTypeRequiredExampleConstraintsDescription
code integer No
message string No
timestamp string No