为用户导入 TOTP
POST
/api/v2/mfa/totp/import
请求参数
Header 参数
Authorization
string
Token
示例值:
Bearer eyJhb
x-authing-userpool-id
string
用户池 ID
示例值:
61b95d6c96d42670da568408
Body 参数application/json
userId
string
用户 ID
secret
string
密钥,自定义
recoveryCode
string
自定义
示例
{
"userId": "string",
"secret": "string",
"recoveryCode": "string"
}
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://core.authing.cn/api/v2/mfa/totp/import' \
--header 'Authorization: Bearer eyJhb' \
--header 'x-authing-userpool-id: 61b95d6c96d42670da568408' \
--header 'Content-Type: application/json' \
--data-raw ''
返回响应
🟢200成功
application/json
Body
code
integer
必需
message
string
必需
data
object
必需
userId
string
必需
enable
boolean
必需
secret
string
必需
authenticatorType
string
必需
recoveryCode
string
必需
createdAt
string
必需
updatedAt
string
必需
id
string
必需
source
string
必需
示例
{
"code": 200,
"message": "添加 TOTP 验证器成功",
"data": {
"userId": "61de786b31d27307c7ce66c3",
"enable": true,
"secret": "sdfdf",
"authenticatorType": "totp",
"recoveryCode": "sdfsdfdsf",
"createdAt": "2022-01-13T07:57:54.073Z",
"updatedAt": "2022-01-13T07:57:54.073Z",
"id": "61dfdb82b3f67714c88cc855",
"source": "SELF"
}
}
修改于 2022-01-24 07:01:35