POST /mfa/credentials/{credential_id}/primary

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

多因素认证 `bearerAuth` application/json

请求参数

名称位置类型必填默认值示例约束描述
credential_id path string 是 凭证ID

请求体

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

字段类型必填示例约束描述
type string 是

响应

引用的 Schema

service-core/base/dto.SimpleResponse

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

service-mfa/internal/handler/dto.SetPrimaryCredentialDetailResponse

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

service-mfa/internal/handler/dto.SetPrimaryCredentialResponse

字段类型必填示例约束描述
credential_id string 否 cred_abc123def456
primary boolean 否 True
type string 否 totp