/mfa/credentials/{id}/primary
将指定的MFA凭证设为该用户的主认证方式,同时取消其他凭证的主认证状态。参考:OWASP ASVS V2.8。
Request Parameters
| Name | In | Type | Required | Default | Example | Constraints | Description |
|---|---|---|---|---|---|---|---|
id |
path |
string |
Yes | 凭证ID |
Request Body
Schema: dto.SetPrimaryCredentialRequest
| Field | Type | Required | Example | Constraints | Description |
|---|---|---|---|---|---|
type |
string |
Yes |
Responses
| Status | Description | Schema |
|---|---|---|
| 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
| Field | Type | Required | Example | Constraints | Description |
|---|---|---|---|---|---|
code |
integer |
No | |||
data |
dto.SetPrimaryCredentialResponse |
No | |||
message |
string |
No | |||
timestamp |
string |
No |
dto.SetPrimaryCredentialResponse
| Field | Type | Required | Example | Constraints | Description |
|---|---|---|---|---|---|
credential_id |
string |
No | cred_abc123def456 |
||
primary |
boolean |
No | True |
||
type |
string |
No | totp |
gitee_com_linmes_authms_base_dto.SimpleResponse
| Field | Type | Required | Example | Constraints | Description |
|---|---|---|---|---|---|
code |
integer |
No | |||
message |
string |
No | |||
timestamp |
string |
No |