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

POST /mfa/credentials/{id}/primary

将指定的MFA凭证设为该用户的主认证方式,同时取消其他凭证的主认证状态。参考:OWASP ASVS V2.8。

MFA `bearerAuth` application/json

Request Parameters

NameInTypeRequiredDefaultExampleConstraintsDescription
id path string Yes 凭证ID

Request Body

Schema: dto.SetPrimaryCredentialRequest

FieldTypeRequiredExampleConstraintsDescription
type string Yes

Responses

StatusDescriptionSchema
200设置成功dto.SetPrimaryCredentialDetailResponse
400参数错误gitee_com_linmes_authms_base_dto.SimpleResponse
401未认证gitee_com_linmes_authms_base_dto.SimpleResponse
404凭证未找到gitee_com_linmes_authms_base_dto.SimpleResponse
500服务器内部错误gitee_com_linmes_authms_base_dto.SimpleResponse

Referenced Schemas

dto.SetPrimaryCredentialDetailResponse

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

dto.SetPrimaryCredentialResponse

FieldTypeRequiredExampleConstraintsDescription
credential_id string No cred_abc123def456
primary boolean No True
type string No totp

gitee_com_linmes_authms_base_dto.SimpleResponse

FieldTypeRequiredExampleConstraintsDescription
code integer No
message string No
timestamp string No