重置双因子认证密匙

API 请求

URLs

PUT zstack/v1/twofactorauthentication/secrets

Headers

Authorization: OAuth the-session-uuid

Body

{
  "resetTwoFactorAuthenticationSecret": {
    "name": "user1",
    "password": "password",
    "type": "ldap"
  },
  "systemTags": [],
  "userTags": []
}

上述示例中systemTagsuserTags字段可以省略。列出是为了表示body中可以包含这两个字段。

Curl示例

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"resetTwoFactorAuthenticationSecret":{"name":"user1","password":"password","type":"ldap"}}' \
http://localhost:8080/zstack/v1/twofactorauthentication/secrets

参数列表

名字

类型

位置

描述

可选值

起始版本

name

String

body(包含在resetTwoFactorAuthenticationSecret结构中)

资源名称

 

4.10.0

password

String

body(包含在resetTwoFactorAuthenticationSecret结构中)

 

 

4.10.0

captchaUuid (可选)

String

body(包含在resetTwoFactorAuthenticationSecret结构中)

 

 

4.10.0

verifyCode (可选)

String

body(包含在resetTwoFactorAuthenticationSecret结构中)

 

 

4.10.0

system Tags (可选)

List

body

系统标签

 

4.10.0

userTags (可选)

List

body

用户标签

 

4.10.0

type

String

body(包含在resetTwoFactorAuthenticationSecret结构中)

 

  • account
  • ldap

5.0.0

SDK示例

Java SDK

ResetTwoFactorAuthenticationSecretAction action = new ResetTwoFactorAuthenticationSecretAction();
action.name = "user1";
action.password = "password";
action.type = "ldap";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ResetTwoFactorAuthenticationSecretAction.Result res = action.call();

Python SDK

action = ResetTwoFactorAuthenticationSecretAction()
action.name = "user1"
action.password = "password"
action.type = "ldap"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()