双因素身份验证
设置双因素身份验证
POST
/api/2fa/setup/initiate开始或替换当前用户待完成的设置,并返回验证器应用的二维码和手动设置密钥。
Headers
| Name | Type | Description |
|---|---|---|
| Authorizationrequired | string | Authentication credentials, e.g. Bearer <token>. |
Responses
200The operation completed successfully.
| Name | Type | Description |
|---|---|---|
| manualKeyrequired | string | Secret key for manually configuring an authenticator app. |
| qrCodeDataUrlrequired | string | Data URL of the QR code for authenticator setup. |
200 example
400Bad request.
| Name | Type | Description |
|---|---|---|
| errorrequired | object | Error details returned when the operation fails. |
400 example
401Unauthorized.
| Name | Type | Description |
|---|---|---|
| errorrequired | object | Error details returned when the operation fails. |
401 example
404Not found.
| Name | Type | Description |
|---|---|---|
| errorrequired | object | Error details returned when the operation fails. |
404 example
503Service unavailable.
| Name | Type | Description |
|---|---|---|
| errorrequired | object | Error details returned when the operation fails. |
503 example
Code samples
cURL